]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.7] time: update test for tzdata-2016g
authorAlberto Donizetti <alb.donizetti@gmail.com>
Thu, 29 Sep 2016 11:59:10 +0000 (13:59 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 25 Jan 2017 17:17:16 +0000 (17:17 +0000)
Backport of the fix to #17276 for Go 1.7.

Change-Id: Ifc1a8e2a81d4e543dbef04566985618884a8c0e0
Reviewed-on: https://go-review.googlesource.com/35635
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/time/time_test.go

index b7ebb372967169123d0ae5c67fc150965531f684..c9665ea04b5f347e6604189d8f55b9ea03305175 100644 (file)
@@ -939,8 +939,11 @@ func TestLoadFixed(t *testing.T) {
        // but Go and most other systems use "east is positive".
        // So GMT+1 corresponds to -3600 in the Go zone, not +3600.
        name, offset := Now().In(loc).Zone()
-       if name != "GMT+1" || offset != -1*60*60 {
-               t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60)
+       // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1"
+       // on earlier versions; we accept both. (Issue #17276).
+       if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 {
+               t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d",
+                       name, offset, "GMT+1", "-01", -1*60*60)
        }
 }