TP03: Add more tests

This commit is contained in:
augustin64 2024-10-10 11:37:00 +02:00
parent ab992cf6f0
commit 646db2fd97
3 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#include "printlib.h"
int main() {
println_bool(true + false);
return 0;
}
// EXITCODE 2
// EXPECTED
// In function main: Line 4 col 15: invalid type for additive operands: boolean and boolean

View File

@ -0,0 +1,27 @@
#include "printlib.h"
int main() {
int num, result, i;
int prev1, prev2, tmp;
result = -1;
num = 15;
if (num < 2) {
result = num;
} else {
prev1 = 1;
prev2 = 0;
for i=2 to num {
tmp = prev1;
prev1 = prev1 + prev2;
prev2 = tmp;
}
result = prev1+prev2;
}
println_int(result);
return 0;
}
// SKIP TEST EXPECTED
// EXPECTED
// 610

View File

@ -0,0 +1,18 @@
#include "printlib.h"
int main() {
int i, count;
for i=0 to 6 {
for i=0 to 6 {
count = count + 1;
}
}
println_int(count);
return 0;
}
// SKIP TEST EXPECTED
// EXPECTED
// 36