aboutsummaryrefslogtreecommitdiff
path: root/test/cmp6.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2020-11-30 21:38:49 -0800
committerRobert Griesemer <gri@golang.org>2020-12-01 21:49:31 +0000
commit72ad2f44eaf8bb71ea100fd4acf7dd04384c7175 (patch)
tree40bb3522f5dcd398280bea526b44921f7b9e572d /test/cmp6.go
parent87bc85a846d5dc2d8fe7dbda900d6066ab98f1a5 (diff)
downloadgo-72ad2f44eaf8bb71ea100fd4acf7dd04384c7175.tar.gz
go-72ad2f44eaf8bb71ea100fd4acf7dd04384c7175.zip
[dev.typeparams] test: add scaffolding to run.go to check compiler with -G flag
Added a new flag -G to run. Setting -G (as in: go run run.go -G) will run tests marked with "errorcheck" (and no other flags) also with the compiler using the new typechecker. Many tests don't pass yet (due to discrepancies in error messages). The top-level tests in the test directory which don't pass yet have been explicitly excluded, permitting to see the current status. Future CLs will bring error messages in sync and eventually all tests should pass. Change-Id: I7caf5eff413e173f68d092af4bbe458434718d74 Reviewed-on: https://go-review.googlesource.com/c/go/+/274313 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/cmp6.go')
-rw-r--r--test/cmp6.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/cmp6.go b/test/cmp6.go
index 7cf76044ef..704ead2caa 100644
--- a/test/cmp6.go
+++ b/test/cmp6.go
@@ -63,16 +63,16 @@ func main() {
use(a3 == a3) // ERROR "invalid operation|invalid comparison"
// Comparison of structs should have a good message
- use(t3 == t3) // ERROR "struct|expected"
- use(t4 == t4) // ERROR "cannot be compared|non-comparable"
+ use(t3 == t3) // ERROR "struct|expected|cannot compare"
+ use(t4 == t4) // ERROR "cannot be compared|non-comparable|cannot compare"
// Slices, functions, and maps too.
var x []int
var f func()
var m map[int]int
- use(x == x) // ERROR "slice can only be compared to nil"
- use(f == f) // ERROR "func can only be compared to nil"
- use(m == m) // ERROR "map can only be compared to nil"
+ use(x == x) // ERROR "slice can only be compared to nil|cannot compare"
+ use(f == f) // ERROR "func can only be compared to nil|cannot compare"
+ use(m == m) // ERROR "map can only be compared to nil|cannot compare"
// Comparison with interface that cannot return true
// (would panic).