Commit 099498db authored by Alberto Donizetti's avatar Alberto Donizetti

time: always run ZoneAbbr test

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 2556df0a
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment