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 <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2022-03-17 17:35:11 -07:00
parent 4dc5553930
commit 29866aa2b6
2 changed files with 8 additions and 14 deletions

View 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)

View 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)