@@ -14,6 +14,7 @@ import (
14
14
"math/rand"
15
15
"os"
16
16
"runtime"
17
+ "slices"
17
18
"strings"
18
19
"sync"
19
20
"testing"
@@ -1124,10 +1125,15 @@ func TestLoadFixed(t *testing.T) {
1124
1125
// So GMT+1 corresponds to -3600 in the Go zone, not +3600.
1125
1126
name , offset := Now ().In (loc ).Zone ()
1126
1127
// The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1"
1127
- // on earlier versions; we accept both. (Issue #17276).
1128
- if ! (name == "GMT+1" || name == "-01" ) || offset != - 1 * 60 * 60 {
1129
- t .Errorf ("Now().In(loc).Zone() = %q, %d, want %q or %q, %d" ,
1130
- name , offset , "GMT+1" , "-01" , - 1 * 60 * 60 )
1128
+ // on earlier versions; we accept both. (Issue 17276.)
1129
+ wantName := []string {"GMT+1" , "-01" }
1130
+ // The zone abbreviation may be "+01" on OpenBSD. (Issue 69840.)
1131
+ if runtime .GOOS == "openbsd" {
1132
+ wantName = append (wantName , "+01" )
1133
+ }
1134
+ if ! slices .Contains (wantName , name ) || offset != - 1 * 60 * 60 {
1135
+ t .Errorf ("Now().In(loc).Zone() = %q, %d, want %q (one of), %d" ,
1136
+ name , offset , wantName , - 1 * 60 * 60 )
1131
1137
}
1132
1138
}
1133
1139
0 commit comments