]> Cypherpunks repositories - gostls13.git/commitdiff
add test for yesterday's interface rule change (interface/convert1.go).
authorRuss Cox <rsc@golang.org>
Thu, 21 May 2009 20:46:20 +0000 (13:46 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 21 May 2009 20:46:20 +0000 (13:46 -0700)
move interface tests to subdirectory.

R=r
DELTA=1632  (827 added, 804 deleted, 1 changed)
OCL=29181
CL=29191

15 files changed:
test/golden.out
test/interface/bigdata.go [moved from test/interface4.go with 100% similarity]
test/interface/convert.go [moved from test/interface11.go with 100% similarity]
test/interface/convert1.go [new file with mode: 0644]
test/interface/embed.go [moved from test/interface10.go with 100% similarity]
test/interface/explicit.go [moved from test/interface5.go with 100% similarity]
test/interface/fail.go [moved from test/interface2.go with 100% similarity]
test/interface/fake.go [moved from test/interface7.go with 100% similarity]
test/interface/pointer.go [moved from test/interface1.go with 100% similarity]
test/interface/receiver.go [moved from test/interface8.go with 91% similarity]
test/interface/receiver1.go [moved from test/interface9.go with 88% similarity]
test/interface/recursive.go [moved from test/interface.go with 78% similarity]
test/interface/returntype.go [moved from test/interface3.go with 100% similarity]
test/interface/struct.go [moved from test/interface6.go with 100% similarity]
test/run

index aaef7c3073812ba50224829c1938031926a26e33..6f0eb13400ffc3bf047fc83eb1ded74a6131fd7a 100644 (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
 
similarity index 100%
rename from test/interface4.go
rename to test/interface/bigdata.go
diff --git a/test/interface/convert1.go b/test/interface/convert1.go
new file mode 100644 (file)
index 0000000..0eff6a9
--- /dev/null
@@ -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;
+}
similarity index 100%
rename from test/interface10.go
rename to test/interface/embed.go
similarity index 100%
rename from test/interface2.go
rename to test/interface/fail.go
similarity index 100%
rename from test/interface7.go
rename to test/interface/fake.go
similarity index 100%
rename from test/interface1.go
rename to test/interface/pointer.go
similarity index 91%
rename from test/interface8.go
rename to test/interface/receiver.go
index 4c2d4d4c5c74f588ec0d6b70616914433e5c9242..438fea015508741dec092877a691197a91ebca66 100644 (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.
 
similarity index 88%
rename from test/interface9.go
rename to test/interface/receiver1.go
index c26bdb0872ae7128d30d16258fb4c0e53aef288c..7f257a3baa05f68bedf85972cd01dc66bd1f44ec 100644 (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
similarity index 78%
rename from test/interface.go
rename to test/interface/recursive.go
index ee03f67f03b3be97176553bc0aa61dbdf1bc9882..707cfcb8c3d780a187c3da66b3e78ea417aebbf6 100644 (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
 
similarity index 100%
rename from test/interface6.go
rename to test/interface/struct.go
index 55c36b0b13818a38dcbe29ae992611cf5f13fd1f..f4bd6e151527e9d3170e1b8fc043229fcf9007c3 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -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