Added test case for switch/case/break
git-svn-id: http://picoc.googlecode.com/svn/trunk@84 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
2f5523f400
commit
2caa072dec
20
tests/06_case.c
Normal file
20
tests/06_case.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
int Count;
|
||||
|
||||
for (Count = 0; Count < 4; Count++)
|
||||
{
|
||||
printint(Count);
|
||||
switch (Count)
|
||||
{
|
||||
case 1:
|
||||
printint(1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printint(2);
|
||||
break;
|
||||
|
||||
default:
|
||||
printint(0);
|
||||
break;
|
||||
}
|
||||
}
|
8
tests/06_case.expect
Normal file
8
tests/06_case.expect
Normal file
|
@ -0,0 +1,8 @@
|
|||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
3
|
||||
0
|
|
@ -3,7 +3,8 @@ TESTS= 00_assignment.test \
|
|||
02_printf.test \
|
||||
03_struct.test \
|
||||
04_for.test \
|
||||
05_array.test
|
||||
05_array.test \
|
||||
06_case.test
|
||||
|
||||
%.test: %.expect %.c
|
||||
@echo Test: $*...
|
||||
|
|
Loading…
Reference in a new issue