mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-31 03:50:36 +00:00
Adding break/continue testcases
This commit is contained in:
parent
6bc72a0262
commit
57e7303cf4
5 changed files with 43 additions and 0 deletions
6
tests/break-1.tmpl
Normal file
6
tests/break-1.tmpl
Normal 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
6
tests/break-2.tmpl
Normal 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
6
tests/break-3.tmpl
Normal 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
6
tests/break-4.tmpl
Normal 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
19
tests/break.qc
Normal 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");
|
||||
}
|
Loading…
Reference in a new issue