aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/typestring_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-03-23 12:44:17 -0700
committerRobert Griesemer <gri@golang.org>2021-03-25 19:20:52 +0000
commitffa9983b998cd9667dec0cc5eeb102b14696e28b (patch)
tree1cabd28bef2b0db156f4b1e19ce27c7ac1edebe8 /src/cmd/compile/internal/types2/typestring_test.go
parent34ef294b76cc129411a572dc1df18a44eaa5768e (diff)
downloadgo-ffa9983b998cd9667dec0cc5eeb102b14696e28b.tar.gz
go-ffa9983b998cd9667dec0cc5eeb102b14696e28b.zip
cmd/compile/internal/types2: review of api_test.go
The changes between (equivalent, and reviewed) go/types/api_test.go and api_test.go can be seen by comparing patchset 1 and 2. The actual changes are removing the "// UNREVIEWED" marker, the addition of the TestConvertibleTo and TestAssignableTo tests, and adjustments to test prefixes (genericPkg, brokenPkg to be in line with go/types). There are several differences to go/types/api_test.go: - use of syntax rather than go/ast package - use of the parseSrc helper function - TestTypesInfo test entries reflect different handling of untyped nil - TestInferredInfo is (for go1.17) in another file controlled by a build constraint in go/types - TestSelection test is currently skipped (types2 position information is not accurate enough) - TestScopeLookupParent doesn't have access to a scanner and instead relies on syntax.CommentsDo. - Broken packages are assumed to contain generic code for the tests. Change-Id: Ic14e6fb9d6bef5416df39e465b5994de76f84097 Reviewed-on: https://go-review.googlesource.com/c/go/+/304131 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typestring_test.go')
-rw-r--r--src/cmd/compile/internal/types2/typestring_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/typestring_test.go b/src/cmd/compile/internal/types2/typestring_test.go
index 97a4fdf73d..d98e9a5ade 100644
--- a/src/cmd/compile/internal/types2/typestring_test.go
+++ b/src/cmd/compile/internal/types2/typestring_test.go
@@ -111,7 +111,7 @@ var dependentTestTypes = []testEntry{
// interfaces
dup(`interface{io.Reader; io.Writer}`),
dup(`interface{m() int; io.Writer}`),
- {`interface{m() interface{T}}`, `interface{m() interface{p.T}}`},
+ {`interface{m() interface{T}}`, `interface{m() interface{generic_p.T}}`},
}
func TestTypeString(t *testing.T) {
@@ -122,7 +122,7 @@ func TestTypeString(t *testing.T) {
tests = append(tests, dependentTestTypes...)
for _, test := range tests {
- src := `package p; import "io"; type _ io.Writer; type T ` + test.src
+ src := `package generic_p; import "io"; type _ io.Writer; type T ` + test.src
pkg, err := makePkg(src)
if err != nil {
t.Errorf("%s: %s", src, err)