aboutsummaryrefslogtreecommitdiff
path: root/test/switch.go
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-06-15 20:24:30 -0700
committerKen Thompson <ken@golang.org>2008-06-15 20:24:30 -0700
commite1a06ccc80159cf2b6a3cd86493c6a53b5a6f9e8 (patch)
treefb752fc19ce6aaf23a67e513f40ea0c80d557560 /test/switch.go
parent073486c3ed10f4f737484253320f44804cac1447 (diff)
downloadgo-e1a06ccc80159cf2b6a3cd86493c6a53b5a6f9e8.tar.gz
go-e1a06ccc80159cf2b6a3cd86493c6a53b5a6f9e8.zip
now checks for lvalue/rvalue context of
expressions. start of generics for calling builtin functions start of map type 'any' demoted from reserved word to type SVN=122808
Diffstat (limited to 'test/switch.go')
-rw-r--r--test/switch.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/switch.go b/test/switch.go
index 602265631e..5fb80c4971 100644
--- a/test/switch.go
+++ b/test/switch.go
@@ -16,6 +16,7 @@ func assert(cond bool, msg string) {
func main() {
i5 := 5;
i7 := 7;
+ hello := "hello";
switch true {
case i5 < 5: assert(false, "<");
@@ -122,6 +123,13 @@ func main() {
}
assert(fired > 0, "fired");
+ switch hello {
+ case "wowie": assert(false, "wowie");
+ case "hello": assert(true, "hello");
+ case "jumpn": assert(false, "jumpn");
+ default: assert(false, "default");
+ }
+
fired = 0;
switch i := i5 + 2; i {
case i7: fired = 1;