mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-22 15:15:22 +02:00
[svn r126] String switch is now implemented.
A few other fixes.
This commit is contained in:
24
test/switch3.d
Normal file
24
test/switch3.d
Normal file
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user