summaryrefslogtreecommitdiff
path: root/test/simassign.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-07-03 16:48:59 -0700
committerRob Pike <r@golang.org>2008-07-03 16:48:59 -0700
commite8f64b7d9febc9902741815958916bc54fccf94c (patch)
tree6369d83d6c39184666ca90c1afc346375b02ed8e /test/simassign.go
parent0c49498c7e27decae852e1db13cf70dbd182391c (diff)
downloadgo-e8f64b7d9febc9902741815958916bc54fccf94c.tar.gz
fix some tests
SVN=125987
Diffstat (limited to 'test/simassign.go')
-rw-r--r--test/simassign.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/simassign.go b/test/simassign.go
index aeb988d7d..5b8c3f39f 100644
--- a/test/simassign.go
+++ b/test/simassign.go
@@ -33,7 +33,13 @@ testit() bool
i == 9;
}
-func main()
+func
+swap(x, y int) (u, v int) {
+ return y, x
+}
+
+func
+main()
{
a = 1;
b = 2;
@@ -65,4 +71,13 @@ func main()
printit();
panic;
}
+
+ a, b = swap(1, 2);
+ if a != 2 || b != 1 {
+ panic "bad swap";
+ }
+//BUG a, b = swap(swap(a, b));
+// if a != 2 || b != 1 {
+// panic "bad swap";
+// }
}