]> Cypherpunks repositories - gostls13.git/commitdiff
time: always run ZoneAbbr test
authorAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 4 Aug 2018 10:04:52 +0000 (12:04 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Mon, 20 Aug 2018 14:39:59 +0000 (14:39 +0000)
CL 52430 added logic to skip the testZoneAbbr test in locales where
the timezone does not have a three-letter name, because the following
line

  Parse(RFC1123, t1.Format(RFC1123))

failed for timezones with only numeric names (like -07).

Since Go 1.11, Parse supports the parsing of timezones with numeric
names (this was implemented in CL 98157), so we can now run the test
unconditionally.

Change-Id: I8ed40e1ba325c0c0dc79c4184a9e71209e2e9a02
Reviewed-on: https://go-review.googlesource.com/127757
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/time/zoneinfo_windows_test.go

index d0f2a444fe8f49eb9feffbe02915fe69fa7f2907..f23d9dcecb83ad2d6dd1209f9f9ef3912753c7a4 100644 (file)
@@ -15,13 +15,6 @@ func testZoneAbbr(t *testing.T) {
        // discard nsec
        t1 = Date(t1.Year(), t1.Month(), t1.Day(), t1.Hour(), t1.Minute(), t1.Second(), 0, t1.Location())
 
-       // Skip the test if we're in a timezone with no abbreviation.
-       // Format will fallback to the numeric abbreviation, and
-       // Parse(RFC1123, ..) will fail (see Issue 21183).
-       if tz := t1.Format("MST"); tz[0] == '-' || tz[0] == '+' {
-               t.Skip("No zone abbreviation")
-       }
-
        t2, err := Parse(RFC1123, t1.Format(RFC1123))
        if err != nil {
                t.Fatalf("Parse failed: %v", err)