]> Cypherpunks repositories - gostls13.git/commitdiff
test: fix error check messages for 2 types2 tests
authorZachary Burkett <zburkett@splitcubestudios.com>
Sat, 29 May 2021 19:54:10 +0000 (19:54 +0000)
committerRobert Griesemer <gri@golang.org>
Wed, 2 Jun 2021 05:14:45 +0000 (05:14 +0000)
Many compiler tests fail with -G=3 due to changes in error message format.
This commit fixes two of these tests, to ensure I am on the right track in review.

Updates #46447

Change-Id: I138956d536a1d48ca9198e6ddbfde13865bb5dd5
GitHub-Last-Rev: 0ed904b9fad5e6739fee02ab48c7bc66508d736b
GitHub-Pull-Request: golang/go#46445
Reviewed-on: https://go-review.googlesource.com/c/go/+/323314
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

test/complit1.go
test/ddd1.go
test/run.go

index 7c2a4e2996d5160a8500a1a3a139f8de156a21c3..8cbcd63ee0d176d93e88b951e758215f776f60d1 100644 (file)
@@ -46,20 +46,20 @@ var (
        _ = &T{0, 0, "", nil}               // ok
        _ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal|omit types within composite literal"
        _ = &T{0, 0, "", {}}                // ERROR "missing type in composite literal|omit types within composite literal"
-       _ = TP{i: 0, f: 0, s: "", next: {}} // ERROR "invalid composite literal type TP|omit types within composite literal"
+       _ = TP{i: 0, f: 0, s: ""}           // ERROR "invalid composite literal type TP"
        _ = &Ti{}                           // ERROR "invalid composite literal type Ti|expected.*type for composite literal"
 )
 
 type M map[T]T
 
 var (
-       _ = M{{i:1}: {i:2}}
-       _ = M{T{i:1}: {i:2}}
-       _ = M{{i:1}: T{i:2}}
-       _ = M{T{i:1}: T{i:2}}
+       _ = M{{i: 1}: {i: 2}}
+       _ = M{T{i: 1}: {i: 2}}
+       _ = M{{i: 1}: T{i: 2}}
+       _ = M{T{i: 1}: T{i: 2}}
 )
 
-type S struct { s [1]*M1 }
+type S struct{ s [1]*M1 }
 type M1 map[S]int
-var _ = M1{{s:[1]*M1{&M1{{}:1}}}:2}
 
+var _ = M1{{s: [1]*M1{&M1{{}: 1}}}: 2}
index ad49b347f49dd66439b17fb86e9d2ad3569fc2e3..f7381b7c946212b7b2686b419b6a706a50b842df 100644 (file)
@@ -17,8 +17,8 @@ var (
        _ = sum(1, 2, 3)
        _ = sum()
        _ = sum(1.0, 2.0)
-       _ = sum(1.5)      // ERROR "integer"
-       _ = sum("hello")  // ERROR ".hello. .type untyped string. as type int|incompatible"
+       _ = sum(1.5)      // ERROR "1\.5 .untyped float constant. as int|integer"
+       _ = sum("hello")  // ERROR ".hello. (.untyped string constant. as int|.type untyped string. as type int)|incompatible"
        _ = sum([]int{1}) // ERROR "\[\]int{...}.*as type int|incompatible"
 )
 
@@ -27,9 +27,9 @@ func tuple() (int, int, int) { return 1, 2, 3 }
 
 var (
        _ = sum(tuple())
-       _ = sum(tuple()...) // ERROR "multiple-value"
+       _ = sum(tuple()...) // ERROR "\.{3} with 3-valued|multiple-value"
        _ = sum3(tuple())
-       _ = sum3(tuple()...) // ERROR "multiple-value" ERROR "invalid use of .*[.][.][.]"
+       _ = sum3(tuple()...) // ERROR "\.{3} in call to non-variadic|multiple-value|invalid use of .*[.][.][.]"
 )
 
 type T []T
@@ -60,5 +60,5 @@ func bad(args ...int) {
        _ = [...]byte("foo") // ERROR "[.][.][.]"
        _ = [...][...]int{{1,2,3},{4,5,6}}      // ERROR "[.][.][.]"
 
-       Foo(x...) // ERROR "invalid use of .*[.][.][.]"
+       Foo(x...) // ERROR "\.{3} in call to non-variadic|invalid use of .*[.][.][.]"
 }
index cf1d30159896ea9a70abe3b75354b48dcf4a287b..ef1e9de1502723f1321a05591095572baf175fa9 100644 (file)
@@ -2023,8 +2023,6 @@ func overlayDir(dstRoot, srcRoot string) error {
 // List of files that the compiler cannot errorcheck with the new typechecker (compiler -G option).
 // Temporary scaffolding until we pass all the tests at which point this map can be removed.
 var excludedFiles = map[string]bool{
-       "complit1.go":     true, // types2 reports extra errors
-       "ddd1.go":         true, // issue #42987
        "directive.go":    true, // misplaced compiler directive checks
        "float_lit3.go":   true, // types2 reports extra errors
        "import1.go":      true, // types2 reports extra errors