Commit b9159722 authored by Russ Cox's avatar Russ Cox

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
parent a016081f
...@@ -26,18 +26,6 @@ panic PC=xxx ...@@ -26,18 +26,6 @@ panic PC=xxx
=========== ./helloworld.go =========== ./helloworld.go
hello, world 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 =========== ./peano.go
0! = 1 0! = 1
1! = 1 1! = 1
...@@ -85,6 +73,18 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz ...@@ -85,6 +73,18 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
=========== chan/nonblock.go =========== chan/nonblock.go
PASS 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 =========== bugs/bug132.go
BUG: compilation succeeds incorrectly BUG: compilation succeeds incorrectly
......
// $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;
}
// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// $G $F.go && $L $F.$A && ./$A.out
// Implicit methods for embedded types. // Implicit methods for embedded types.
// Mixed pointer and non-pointer receivers. // Mixed pointer and non-pointer receivers.
......
// errchk $G $D/$F.go
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// errchk $G $F.go
// Error messages about missing implicit methods. // Error messages about missing implicit methods.
package main package main
......
// $G $D/$F.go || echo BUG: should compile
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// $G $D/$F.go || echo BUG: should compile // Check mutually recursive interfaces
package main package main
......
...@@ -30,7 +30,7 @@ TMP2FILE=/tmp/gotest2-$USER ...@@ -30,7 +30,7 @@ TMP2FILE=/tmp/gotest2-$USER
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails. # on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
ulimit -v 4000000 ulimit -v 4000000
for dir in . ken chan bugs fixedbugs for dir in . ken chan interface bugs fixedbugs
do do
for i in $dir/*.go for i in $dir/*.go
do do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment