]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types, types2: remove predecl. test functions from ordinary tests
authorRobert Griesemer <gri@golang.org>
Fri, 18 Mar 2022 00:35:11 +0000 (17:35 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 21 Mar 2022 19:10:57 +0000 (19:10 +0000)
The type checker implements additional built-in functions (assert
and trace) that are useful for debugging. Only permit them in
manual tests (go test -run Manual), not for other tests where they
are not needed.

Change-Id: Idc7723d9e3f6b2c27769b34743561e9d0339565c
Reviewed-on: https://go-review.googlesource.com/c/go/+/393659
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/check_test.go
src/go/types/check_test.go

index fa6d465acc56dda08ca329a64e5bbe0b64a0633a..cdf440f9be7a2753a2adb6d0b268f67e082e1183 100644 (file)
@@ -297,13 +297,10 @@ func TestManual(t *testing.T) {
 
 // TODO(gri) go/types has extra TestLongConstants and TestIndexRepresentability tests
 
-func TestCheck(t *testing.T)    { DefPredeclaredTestFuncs(); testDirFiles(t, "testdata/check", 55, false) } // TODO(gri) narrow column tolerance
-func TestSpec(t *testing.T)     { DefPredeclaredTestFuncs(); testDirFiles(t, "testdata/spec", 0, false) }
-func TestExamples(t *testing.T) { testDirFiles(t, "testdata/examples", 0, false) }
-func TestFixedbugs(t *testing.T) {
-       DefPredeclaredTestFuncs()
-       testDirFiles(t, "testdata/fixedbugs", 0, false)
-}
+func TestCheck(t *testing.T)     { testDirFiles(t, "testdata/check", 55, false) } // TODO(gri) narrow column tolerance
+func TestSpec(t *testing.T)      { testDirFiles(t, "testdata/spec", 0, false) }
+func TestExamples(t *testing.T)  { testDirFiles(t, "testdata/examples", 0, false) }
+func TestFixedbugs(t *testing.T) { testDirFiles(t, "testdata/fixedbugs", 0, false) }
 
 func testDirFiles(t *testing.T, dir string, colDelta uint, manual bool) {
        testenv.MustHaveGoBuild(t)
index 73b8de8fd4e9409e8ac9f585b293bc145af1895a..592ced41ec4b83af79ec4aca6f04f097d15d98e0 100644 (file)
@@ -369,13 +369,10 @@ func TestIssue47243_TypedRHS(t *testing.T) {
        testFiles(t, &StdSizes{4, 4}, []string{"p.go"}, [][]byte{[]byte(src)}, false, nil)
 }
 
-func TestCheck(t *testing.T)    { DefPredeclaredTestFuncs(); testDirFiles(t, "testdata/check", false) }
-func TestSpec(t *testing.T)     { DefPredeclaredTestFuncs(); testDirFiles(t, "testdata/spec", false) }
-func TestExamples(t *testing.T) { testDirFiles(t, "testdata/examples", false) }
-func TestFixedbugs(t *testing.T) {
-       DefPredeclaredTestFuncs()
-       testDirFiles(t, "testdata/fixedbugs", false)
-}
+func TestCheck(t *testing.T)     { testDirFiles(t, "testdata/check", false) }
+func TestSpec(t *testing.T)      { testDirFiles(t, "testdata/spec", false) }
+func TestExamples(t *testing.T)  { testDirFiles(t, "testdata/examples", false) }
+func TestFixedbugs(t *testing.T) { testDirFiles(t, "testdata/fixedbugs", false) }
 
 func testDirFiles(t *testing.T, dir string, manual bool) {
        testenv.MustHaveGoBuild(t)