]> Cypherpunks repositories - gostls13.git/commitdiff
net/mail: don't use MDT in test
authorIan Lance Taylor <iant@golang.org>
Wed, 23 Dec 2020 22:01:12 +0000 (14:01 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 25 Dec 2020 23:54:24 +0000 (23:54 +0000)
When time.Parse sees a timezone name that matches the local timezone,
it uses the local timezone. The tests weren't expecting that,
so using MDT broke with TZ=America/Boise (where MDT means Mountain
Daylight Time). Just use GMT instead.

Fixes #43354

Change-Id: Ida70c8c867e2568b1535d1dfbf1fb0ed9e0e5c1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/280072
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
src/net/mail/message_test.go

index 0daa3d6c63298ecdf45af27e7602e986f8efc01f..80a17b2853ae45bbec72c2944e10f95ba05e47b6 100644 (file)
@@ -107,8 +107,8 @@ func TestDateParsing(t *testing.T) {
                        time.Date(1997, 11, 20, 9, 55, 6, 0, time.FixedZone("", -6*60*60)),
                },
                {
-                       "Thu, 20 Nov 1997 09:55:06 MDT (MDT)",
-                       time.Date(1997, 11, 20, 9, 55, 6, 0, time.FixedZone("MDT", 0)),
+                       "Thu, 20 Nov 1997 09:55:06 GMT (GMT)",
+                       time.Date(1997, 11, 20, 9, 55, 6, 0, time.UTC),
                },
                {
                        "Fri, 21 Nov 1997 09:55:06 +1300 (TOT)",
@@ -278,8 +278,8 @@ func TestDateParsingCFWS(t *testing.T) {
                        true,
                },
                {
-                       "Fri, 21 Nov 1997 09:55:06 MDT (MDT)",
-                       time.Date(1997, 11, 21, 9, 55, 6, 0, time.FixedZone("MDT", 0)),
+                       "Fri, 21 Nov 1997 09:55:06 GMT (GMT)",
+                       time.Date(1997, 11, 21, 9, 55, 6, 0, time.UTC),
                        true,
                },
        }