diff options
author | Robert Griesemer <gri@golang.org> | 2021-04-28 15:08:47 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-04-29 15:54:27 +0000 |
commit | 948a262455346c6035df6bd5dc36c5d4b6aca409 (patch) | |
tree | a9facf2b7f8fabf909e759fd43df250e57979212 /src/cmd/compile/internal/types2/check_test.go | |
parent | 12eaefead46d7ba10fce622f093d4c9b2989a5c0 (diff) | |
download | go-948a262455346c6035df6bd5dc36c5d4b6aca409.tar.gz go-948a262455346c6035df6bd5dc36c5d4b6aca409.zip |
cmd/compile/internal/types2: nest all test data under the testdata directory
This matches https://golang.org/cl/314829 for go/types.
Change-Id: If3d127af0557bb13d504581920ea03e39db0eb07
Reviewed-on: https://go-review.googlesource.com/c/go/+/314772
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/check_test.go')
-rw-r--r-- | src/cmd/compile/internal/types2/check_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/types2/check_test.go b/src/cmd/compile/internal/types2/check_test.go index 1ecd43778e..61bff28c8e 100644 --- a/src/cmd/compile/internal/types2/check_test.go +++ b/src/cmd/compile/internal/types2/check_test.go @@ -42,8 +42,8 @@ import ( var ( haltOnError = flag.Bool("halt", false, "halt on error") listErrors = flag.Bool("errlist", false, "list errors") - testFiles = flag.String("files", "", "comma-separated list of test files") - goVersion = flag.String("lang", "", "Go language version (e.g. \"go1.12\"") + testFiles = flag.String("files", "", "comma-separated list of TestManual") + goVersion = flag.String("lang", "", "Go language version (e.g. \"go1.12\") for TestManual") ) func parseFiles(t *testing.T, filenames []string, mode syntax.Mode) ([]*syntax.File, []error) { @@ -239,9 +239,9 @@ func checkFiles(t *testing.T, filenames []string, goVersion string, colDelta uin } } -// TestCheck is for manual testing of selected input files, provided with -files. +// TestManual is for manual testing of selected input files, provided with -files. // The accepted Go language version can be controlled with the -lang flag. -func TestCheck(t *testing.T) { +func TestManual(t *testing.T) { if *testFiles == "" { return } @@ -252,13 +252,14 @@ func TestCheck(t *testing.T) { // TODO(gri) go/types has extra TestLongConstants and TestIndexRepresentability tests -func TestTestdata(t *testing.T) { DefPredeclaredTestFuncs(); testDir(t, "testdata", 75) } // TODO(gri) narrow column tolerance +func TestCheck(t *testing.T) { DefPredeclaredTestFuncs(); testDir(t, "check", 75) } // TODO(gri) narrow column tolerance func TestExamples(t *testing.T) { testDir(t, "examples", 0) } func TestFixedbugs(t *testing.T) { testDir(t, "fixedbugs", 0) } func testDir(t *testing.T, dir string, colDelta uint) { testenv.MustHaveGoBuild(t) + dir = filepath.Join("testdata", dir) fis, err := os.ReadDir(dir) if err != nil { t.Error(err) |