]> Cypherpunks repositories - gostls13.git/commitdiff
test: don't rely on order of unrelated imports in bug191
authorIan Lance Taylor <iant@golang.org>
Tue, 10 Dec 2013 20:05:37 +0000 (12:05 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 10 Dec 2013 20:05:37 +0000 (12:05 -0800)
There is no necessary relationship between the imports of the
packages a and b, and gccgo happens to import them in a
different order, leading to different output.  This ordering
is not the purpose of the test in any case.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40400043

test/fixedbugs/bug191.dir/a.go
test/fixedbugs/bug191.dir/b.go
test/fixedbugs/bug191.dir/main.go
test/fixedbugs/bug191.go
test/fixedbugs/bug191.out [deleted file]

index b87ad6f4fee3fdbaaf9ab985d112dba1012ad772..139a8a3a2307d0814548dc16ba0a908e3a280e19 100644 (file)
@@ -4,8 +4,10 @@
 
 package a
 
+var A int
+
 func init() {
-       println("a");
+       A = 1
 }
 
 type T int;
index 3e780ac0dd82641d51a7b24e28b57ad2d50ba7b5..36770f6fc99e3f814ec16dd13d4d2f305a81dc98 100644 (file)
@@ -4,8 +4,10 @@
 
 package b
 
+var B int
+
 func init() {
-       println("b");
+       B = 2
 }
 
 type V int;
index 995134ccfcb2f4f2e2667ae4c8f7cef66b0ae5b4..2d24dd12d5293d97e7891dd52493e2e393e8cc68 100644 (file)
@@ -11,4 +11,7 @@ var _ T
 var _ V
 
 func main() {
+       if A != 1 || B != 2 {
+               panic("wrong vars")
+       }
 }
index acb4796b33db03565d5e53841421815f1d5e38d7..248e23edfc6af34ac2c2beba9c81b56a509cba39 100644 (file)
@@ -1,4 +1,4 @@
-// rundircmpout
+// rundir
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug191.out b/test/fixedbugs/bug191.out
deleted file mode 100644 (file)
index 0e1677a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-b
-a