diff options
| author | Dmitri Shuralyov <dmitshur@golang.org> | 2024-11-04 17:36:26 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-11-19 18:02:54 +0000 |
| commit | 3355db96902ebc2403e08de9ced8a495f29ec870 (patch) | |
| tree | 0d659896c9fde47a20dcf07bec5519c7c9a9d5b3 | |
| parent | 8af39d30a4c4cf68d566345f26224c191960d9b0 (diff) | |
| download | go-3355db96902ebc2403e08de9ced8a495f29ec870.tar.xz | |
[release-branch.go1.22] time: accept "+01" in TestLoadFixed on OpenBSD
This stops the test from failing with a known failure mode, and
creates time to look into what the next steps should be, if any.
For #69840.
Fixes #70238.
Change-Id: I060903d256ed65c5dfcd70ae76eb361cab63186f
Reviewed-on: https://go-review.googlesource.com/c/go/+/625197
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eric Grosse <grosse@gmail.com>
(cherry picked from commit bea9b91f0f4be730c880edbe496ab25c9b742cad)
Reviewed-on: https://go-review.googlesource.com/c/go/+/627416
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
| -rw-r--r-- | src/time/time_test.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/time/time_test.go b/src/time/time_test.go index 86335e3796..227fec943b 100644 --- a/src/time/time_test.go +++ b/src/time/time_test.go @@ -14,6 +14,7 @@ import ( "math/rand" "os" "runtime" + "slices" "strings" "sync" "testing" @@ -1084,10 +1085,15 @@ func TestLoadFixed(t *testing.T) { // So GMT+1 corresponds to -3600 in the Go zone, not +3600. name, offset := Now().In(loc).Zone() // 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) + // on earlier versions; we accept both. (Issue 17276.) + wantName := []string{"GMT+1", "-01"} + // The zone abbreviation may be "+01" on OpenBSD. (Issue 69840.) + if runtime.GOOS == "openbsd" { + wantName = append(wantName, "+01") + } + if !slices.Contains(wantName, name) || offset != -1*60*60 { + t.Errorf("Now().In(loc).Zone() = %q, %d, want %q (one of), %d", + name, offset, wantName, -1*60*60) } } |
