diff options
author | Russ Cox <rsc@golang.org> | 2011-08-16 11:14:26 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-08-16 11:14:26 -0400 |
commit | a5d7c1f45e0b36a34462fd8ce10b869e7a12f246 (patch) | |
tree | 5fe6922112e135cbb00c6ec24c4e321024f74de8 /test/interface | |
parent | 53573c02b8195a55f1c91c2df39e6f1c08cd33d5 (diff) | |
download | go-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/interface')
-rw-r--r-- | test/interface/explicit.go | 2 | ||||
-rw-r--r-- | test/interface/pointer.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/interface/explicit.go b/test/interface/explicit.go index b6a582fffb..daae59b361 100644 --- a/test/interface/explicit.go +++ b/test/interface/explicit.go @@ -48,7 +48,7 @@ func main() { i2 = I2(i) // ERROR "invalid|missing N method" e = E(t) // ok - t = T(e) // ERROR "need explicit|need type assertion|incompatible" + t = T(e) // ERROR "need explicit|need type assertion|incompatible" "as type [*]T" } type M interface { diff --git a/test/interface/pointer.go b/test/interface/pointer.go index 076469c8de..fe4d8e3ef9 100644 --- a/test/interface/pointer.go +++ b/test/interface/pointer.go @@ -33,5 +33,5 @@ func main() { print("call addinst\n") var x Inst = AddInst(new(Start)) // ERROR "pointer to interface" print("return from addinst\n") - var x *Inst = new(Start) // ERROR "pointer to interface" + var y *Inst = new(Start) // ERROR "pointer to interface" } |