diff mbox

libgo patch committed: Fix time test for recent timezone data update

Message ID CAOyqgcUyZ_JY+8UyiNLWqRamE_GSVKdWJfDvOE3s7W6x2+CUHg@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Oct. 28, 2016, 8:22 p.m. UTC
This libgo patch fixes the time test for systems that using the recent
tzdata-2016g update, which added a new zone abbreviation.
Bootstrapped and ran time test on x86_64-pc-linux-gnu.  Committed to
mainline and GCC 6 branch.

Ian
diff mbox

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 241659)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-4a8df8f8622c140777996786866395448622ac3f
+5ddcdfb0b2bb992a70b391ab34bf15291a514e48
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/time/time_test.go
===================================================================
--- libgo/go/time/time_test.go	(revision 241341)
+++ libgo/go/time/time_test.go	(working copy)
@@ -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)
 	}
 }