From: Robert Griesemer Date: Fri, 18 Mar 2022 00:35:11 +0000 (-0700) Subject: go/types, types2: remove predecl. test functions from ordinary tests X-Git-Tag: go1.19beta1~972 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=29866aa2b6a6a48672a386d05b53779e768c13d6;p=gostls13.git go/types, types2: remove predecl. test functions from ordinary tests 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 Reviewed-by: Robert Findley --- diff --git a/src/cmd/compile/internal/types2/check_test.go b/src/cmd/compile/internal/types2/check_test.go index fa6d465acc..cdf440f9be 100644 --- a/src/cmd/compile/internal/types2/check_test.go +++ b/src/cmd/compile/internal/types2/check_test.go @@ -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) diff --git a/src/go/types/check_test.go b/src/go/types/check_test.go index 73b8de8fd4..592ced41ec 100644 --- a/src/go/types/check_test.go +++ b/src/go/types/check_test.go @@ -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)