Mercurial > projects > ldc
diff test/switch3.d @ 122:36ab367572df trunk
[svn r126] String switch is now implemented.
A few other fixes.
author | lindquist |
---|---|
date | Tue, 27 Nov 2007 09:19:07 +0100 |
parents | |
children | d9d5d59873d8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/switch3.d Tue Nov 27 09:19:07 2007 +0100 @@ -0,0 +1,24 @@ +module switch3; + +void main() +{ + char[] str = "hello"; + int i; + switch(str) + { + case "world": + i = 1; + assert(0); + case "hello": + i = 2; + break; + case "a","b","c": + i = 3; + assert(0); + default: + i = 4; + assert(0); + } + assert(i == 2); + printf("SUCCESS\n"); +}