annotate tests/mini/switch3.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents test/switch3.d@d9d5d59873d8
children
rev   line source
lindquist@122 1 module switch3;
lindquist@270 2 extern(C) int printf(char*, ...);
lindquist@122 3
lindquist@122 4 void main()
lindquist@122 5 {
lindquist@122 6 char[] str = "hello";
lindquist@122 7 int i;
lindquist@122 8 switch(str)
lindquist@122 9 {
lindquist@122 10 case "world":
lindquist@122 11 i = 1;
lindquist@122 12 assert(0);
lindquist@122 13 case "hello":
lindquist@122 14 i = 2;
lindquist@122 15 break;
lindquist@122 16 case "a","b","c":
lindquist@122 17 i = 3;
lindquist@122 18 assert(0);
lindquist@122 19 default:
lindquist@122 20 i = 4;
lindquist@122 21 assert(0);
lindquist@122 22 }
lindquist@122 23 assert(i == 2);
lindquist@122 24 printf("SUCCESS\n");
lindquist@122 25 }