]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: establish type-checker specific local tests
authorRobert Griesemer <gri@golang.org>
Thu, 1 Sep 2022 00:29:28 +0000 (17:29 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 2 Sep 2022 02:15:21 +0000 (02:15 +0000)
Establish testdata/local directory for tests that are not (yet)
shared between the go/types and types2. Move issue47996.go into
that directory.

For #54511.

Change-Id: I274b119990a93cc3657bdddc5246948699226c21
Reviewed-on: https://go-review.googlesource.com/c/go/+/426660
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/check_test.go
src/cmd/compile/internal/types2/testdata/local/issue47996.go [moved from src/cmd/compile/internal/types2/testdata/issue47996.go with 100% similarity]
src/go/types/check_test.go
src/go/types/testdata/local/issue47996.go [new file with mode: 0644]

index 8099b8b8d32b6a3d21ded3773287643d79ded16e..cce686ce669577bafcac99cc9e5eb648256099a0 100644 (file)
@@ -305,7 +305,8 @@ func TestSpec(t *testing.T)     { testDirFiles(t, "../../../../go/types/testdata
 func TestExamples(t *testing.T) { testDirFiles(t, "../../../../go/types/testdata/examples", 45, false) } // TODO(gri) narrow column tolerance
 func TestFixedbugs(t *testing.T) {
        testDirFiles(t, "../../../../go/types/testdata/fixedbugs", 100, false)
-} // TODO(gri) narrow column tolerance
+}                            // TODO(gri) narrow column tolerance
+func TestLocal(t *testing.T) { testDirFiles(t, "testdata/local", 0, false) }
 
 func testDirFiles(t *testing.T, dir string, colDelta uint, manual bool) {
        testenv.MustHaveGoBuild(t)
index 8f7bbe4d0e2e5063c77368f1804521dcd875db98..3f68385ade73f9d45a8081393d262da4e0e57134 100644 (file)
@@ -362,6 +362,7 @@ func TestCheck(t *testing.T)     { DefPredeclaredTestFuncs(); testDirFiles(t, "t
 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 TestLocal(t *testing.T)     { testDirFiles(t, "testdata/local", false) }
 
 func testDirFiles(t *testing.T, dir string, manual bool) {
        testenv.MustHaveGoBuild(t)
diff --git a/src/go/types/testdata/local/issue47996.go b/src/go/types/testdata/local/issue47996.go
new file mode 100644 (file)
index 0000000..4d28920
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+// don't crash
+// TODO(gri) make this test work for go/types
+// func T[P] m() {}