mirror of
https://github.com/golang/go
synced 2024-11-25 05:57:57 -07:00
add test for yesterday's interface rule change (interface/convert1.go).
move interface tests to subdirectory. R=r DELTA=1632 (827 added, 804 deleted, 1 changed) OCL=29181 CL=29191
This commit is contained in:
parent
a016081f43
commit
b9159722dd
@ -26,18 +26,6 @@ panic PC=xxx
|
||||
=========== ./helloworld.go
|
||||
hello, world
|
||||
|
||||
=========== ./interface2.go
|
||||
cannot convert type *main.S to interface main.I: missing method Foo
|
||||
throw: interface conversion
|
||||
|
||||
panic PC=xxx
|
||||
|
||||
=========== ./interface3.go
|
||||
cannot convert type *main.S to interface main.I2: missing method Name
|
||||
throw: interface conversion
|
||||
|
||||
panic PC=xxx
|
||||
|
||||
=========== ./peano.go
|
||||
0! = 1
|
||||
1! = 1
|
||||
@ -85,6 +73,18 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
|
||||
=========== chan/nonblock.go
|
||||
PASS
|
||||
|
||||
=========== interface/fail.go
|
||||
cannot convert type *main.S to interface main.I: missing method Foo
|
||||
throw: interface conversion
|
||||
|
||||
panic PC=xxx
|
||||
|
||||
=========== interface/returntype.go
|
||||
cannot convert type *main.S to interface main.I2: missing method Name
|
||||
throw: interface conversion
|
||||
|
||||
panic PC=xxx
|
||||
|
||||
=========== bugs/bug132.go
|
||||
BUG: compilation succeeds incorrectly
|
||||
|
||||
|
25
test/interface/convert1.go
Normal file
25
test/interface/convert1.go
Normal file
@ -0,0 +1,25 @@
|
||||
// $G $D/$F.go && $L $F.$A && ./$A.out
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Check that static interface conversion of
|
||||
// interface value nil succeeds.
|
||||
|
||||
package main
|
||||
|
||||
type R interface { R(); }
|
||||
type RW interface { R(); W(); }
|
||||
|
||||
var e interface {}
|
||||
var r R;
|
||||
var rw RW;
|
||||
|
||||
func main() {
|
||||
r = r;
|
||||
r = rw;
|
||||
e = r;
|
||||
e = rw;
|
||||
rw = rw;
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
// $G $D/$F.go && $L $F.$A && ./$A.out
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// $G $F.go && $L $F.$A && ./$A.out
|
||||
|
||||
// Implicit methods for embedded types.
|
||||
// Mixed pointer and non-pointer receivers.
|
||||
|
@ -1,9 +1,9 @@
|
||||
// errchk $G $D/$F.go
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// errchk $G $F.go
|
||||
|
||||
// Error messages about missing implicit methods.
|
||||
|
||||
package main
|
@ -1,8 +1,10 @@
|
||||
// $G $D/$F.go || echo BUG: should compile
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// $G $D/$F.go || echo BUG: should compile
|
||||
// Check mutually recursive interfaces
|
||||
|
||||
package main
|
||||
|
Loading…
Reference in New Issue
Block a user