Added missing tests
git-svn-id: http://picoc.googlecode.com/svn/trunk@178 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
1fd07ea9a2
commit
460a8df81f
13
tests/14_if.c
Normal file
13
tests/14_if.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
int a = 1;
|
||||
|
||||
if (a)
|
||||
printf("a is true\n");
|
||||
else
|
||||
printf("a is false\n");
|
||||
|
||||
int b = 0;
|
||||
if (b)
|
||||
printf("b is true\n");
|
||||
else
|
||||
printf("b is false\n");
|
||||
|
2
tests/14_if.expect
Normal file
2
tests/14_if.expect
Normal file
|
@ -0,0 +1,2 @@
|
|||
a is true
|
||||
b is false
|
10
tests/15_recursion.c
Normal file
10
tests/15_recursion.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
int fact(int i) {
|
||||
if (i < 2) {
|
||||
return i;
|
||||
}
|
||||
return (i * fact(i - 1));
|
||||
}
|
||||
|
||||
fact(5)
|
||||
fact(6)
|
||||
|
2
tests/15_recursion.expect
Normal file
2
tests/15_recursion.expect
Normal file
|
@ -0,0 +1,2 @@
|
|||
120
|
||||
720
|
Loading…
Reference in a new issue