aboutsummaryrefslogtreecommitdiff
path: root/test/shift1.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-08-16 11:14:26 -0400
committerRuss Cox <rsc@golang.org>2011-08-16 11:14:26 -0400
commita5d7c1f45e0b36a34462fd8ce10b869e7a12f246 (patch)
tree5fe6922112e135cbb00c6ec24c4e321024f74de8 /test/shift1.go
parent53573c02b8195a55f1c91c2df39e6f1c08cd33d5 (diff)
downloadgo-a5d7c1f45e0b36a34462fd8ce10b869e7a12f246.tar.gz
go-a5d7c1f45e0b36a34462fd8ce10b869e7a12f246.zip
errchk: allow multiple patterns
// ERROR "pattern1" "pattern2" means that there has to be one or more lines matching pattern1 and then excluding those, there have to be one or more lines matching pattern2. So if you expect two different error messages from a particular line, writing two separate patterns checks that both errors are produced. Also, errchk now flags lines that produce more errors than expected. Before, as long as at least one error matched the pattern, all the others were ignored. Revise tests to expect or silence these additional errors. R=lvd, r, iant CC=golang-dev https://golang.org/cl/4869044
Diffstat (limited to 'test/shift1.go')
-rw-r--r--test/shift1.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/shift1.go b/test/shift1.go
index 8fa48a03cf..6a8e26e5e6 100644
--- a/test/shift1.go
+++ b/test/shift1.go
@@ -16,13 +16,13 @@ func h(x float64) int { return 0 }
var (
s uint = 33
u = 1.0 << s // ERROR "invalid operation"
- v float32 = 1 << s // ERROR "invalid operation"
+ v float32 = 1 << s // ERROR "invalid operation" "as type float32"
)
// non-constant shift expressions
var (
- e1 = g(2.0 << s) // ERROR "invalid operation"
- f1 = h(2 << s) // ERROR "invalid operation"
+ e1 = g(2.0 << s) // ERROR "invalid operation" "as type interface"
+ f1 = h(2 << s) // ERROR "invalid operation" "as type float64"
g1 int64 = 1.1 << s // ERROR "truncated"
)