From: David Chase Date: Tue, 9 May 2023 21:23:39 +0000 (-0400) Subject: internal/godebug: make test godebug calls not vary X-Git-Tag: go1.21rc1~605 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=623ebad6850578a8a51d4d73f6ceab2d7de75fd1;p=gostls13.git internal/godebug: make test godebug calls not vary I think there may be an issue in bisect search with change set elements not actually being independent, to be explored later. For now, modify the test to remove that property. Change-Id: I4b171bc024795d950cf4663374ad1dfc4e2952fc Reviewed-on: https://go-review.googlesource.com/c/go/+/494036 Run-TryBot: David Chase TryBot-Result: Gopher Robot Reviewed-by: Russ Cox --- diff --git a/src/internal/godebug/godebug_test.go b/src/internal/godebug/godebug_test.go index 35b12efe9c..8e46283ada 100644 --- a/src/internal/godebug/godebug_test.go +++ b/src/internal/godebug/godebug_test.go @@ -100,23 +100,31 @@ func TestCmdBisect(t *testing.T) { } // This test does nothing by itself, but you can run +// // bisect 'GODEBUG=buggy=1#PATTERN' go test -run=BisectTestCase +// // to see that the GODEBUG bisect support is working. // TestCmdBisect above does exactly that. func TestBisectTestCase(t *testing.T) { s := New("#buggy") for i := 0; i < 10; i++ { - if s.Value() == "1" { + a := s.Value() == "1" + b := s.Value() == "1" + c := s.Value() == "1" // BISECT BUG + d := s.Value() == "1" // BISECT BUG + e := s.Value() == "1" // BISECT BUG + + if a { t.Log("ok") } - if s.Value() == "1" { + if b { t.Log("ok") } - if s.Value() == "1" { // BISECT BUG + if c { t.Error("bug") } - if s.Value() == "1" && // BISECT BUG - s.Value() == "1" { // BISECT BUG + if d && + e { t.Error("bug") } }