]> Cypherpunks repositories - gostls13.git/commitdiff
internal/godebug: make test godebug calls not vary
authorDavid Chase <drchase@google.com>
Tue, 9 May 2023 21:23:39 +0000 (17:23 -0400)
committerDavid Chase <drchase@google.com>
Wed, 10 May 2023 20:40:05 +0000 (20:40 +0000)
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 <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/internal/godebug/godebug_test.go

index 35b12efe9c576edcda87e9f30342d1612c8a1554..8e46283adab3267a9f7bf671791748c03eecaf00 100644 (file)
@@ -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")
                }
        }