Adding break/continue testcases

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-20 00:21:03 +01:00
parent 6bc72a0262
commit 57e7303cf4
5 changed files with 43 additions and 0 deletions

6
tests/break-1.tmpl Normal file
View file

@ -0,0 +1,6 @@
I: break.qc
D: test break and continue - case 1
T: -execute
C: -std=fteqcc
E: -float -1 -float -1
M: 0 1 2 3 4 5 6 7 8 9 end

6
tests/break-2.tmpl Normal file
View file

@ -0,0 +1,6 @@
I: break.qc
D: test break and continue - case 2
T: -execute
C: -std=fteqcc
E: -float 3 -float -1
M: 0 1 2 3 brk end

6
tests/break-3.tmpl Normal file
View file

@ -0,0 +1,6 @@
I: break.qc
D: test break and continue - case 3
T: -execute
C: -std=fteqcc
E: -float -1 -float 3
M: 0 1 2 ct 4 5 6 7 8 9 end

6
tests/break-4.tmpl Normal file
View file

@ -0,0 +1,6 @@
I: break.qc
D: test break and continue - case 4
T: -execute
C: -std=fteqcc
E: -float 5 -float 2
M: 0 1 ct 3 4 5 brk end

19
tests/break.qc Normal file
View file

@ -0,0 +1,19 @@
void print(...) = #1;
string ftos (float) = #2;
void main(float brkat, float contat) {
float i;
for (i = 0; i < 10; i += 1) {
if (i == contat) {
print("ct ");
continue;
}
print(ftos(i), " ");
if (i == brkat) {
print("brk ");
break;
}
}
print("end\n");
}