Added more tests
This commit is contained in:
parent
dbf416d45b
commit
57ee65abd1
9 changed files with 77 additions and 2 deletions
44
tests/programs/switch.q
Normal file
44
tests/programs/switch.q
Normal file
|
@ -0,0 +1,44 @@
|
|||
import sys
|
||||
|
||||
main() {
|
||||
correct := 0
|
||||
|
||||
switch {
|
||||
1 == 1 { correct += 1 }
|
||||
}
|
||||
|
||||
switch {
|
||||
1 == 1 { correct += 1 }
|
||||
_ { correct -= 1 }
|
||||
}
|
||||
|
||||
switch {
|
||||
0 == 1 { correct -= 1 }
|
||||
_ { correct += 1 }
|
||||
}
|
||||
|
||||
switch {
|
||||
0 == 1 { correct -= 1 }
|
||||
0 == 2 { correct -= 1 }
|
||||
_ { correct += 1 }
|
||||
}
|
||||
|
||||
switch {
|
||||
0 == 1 { correct -= 1 }
|
||||
0 == 2 { correct -= 1 }
|
||||
2 == 2 { correct += 1 }
|
||||
_ { correct -= 1 }
|
||||
}
|
||||
|
||||
switch {
|
||||
0 == 1 { correct -= 1 }
|
||||
0 == 2 { correct -= 1 }
|
||||
0 == 3 { correct -= 1 }
|
||||
}
|
||||
|
||||
if correct == 5 {
|
||||
return
|
||||
}
|
||||
|
||||
sys.exit(1)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue