1
0
mirror of https://github.com/golang/go synced 2024-11-22 02:44:39 -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:
Russ Cox 2009-05-21 13:46:20 -07:00
parent a016081f43
commit b9159722dd
15 changed files with 48 additions and 21 deletions

View File

@ -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

View 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;
}

View File

@ -1,9 +1,9 @@
// Copyright 2009 The Go Authors. All rights reserved.
// $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.

View File

@ -1,9 +1,9 @@
// Copyright 2009 The Go Authors. All rights reserved.
// 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

View File

@ -1,8 +1,10 @@
// Copyright 2009 The Go Authors. All rights reserved.
// $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

View File

@ -30,7 +30,7 @@ TMP2FILE=/tmp/gotest2-$USER
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
ulimit -v 4000000
for dir in . ken chan bugs fixedbugs
for dir in . ken chan interface bugs fixedbugs
do
for i in $dir/*.go
do