mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 05:23:20 +00:00
adds statements test code
This commit is contained in:
@@ -331,3 +331,4 @@ testNifEncDec(graph, "modtestliterals.nim")
|
||||
testNifEncDec(graph, "modtesttypesections.nim")
|
||||
testNifEncDec(graph, "modtestpragmas.nim")
|
||||
testNifEncDec(graph, "modtestprocs.nim")
|
||||
testNifEncDec(graph, "modteststatements.nim")
|
||||
|
||||
44
tests/icnif/testcode/modteststatements.nim
Normal file
44
tests/icnif/testcode/modteststatements.nim
Normal file
@@ -0,0 +1,44 @@
|
||||
var stmtListExpr = (echo "foo"; 111)
|
||||
|
||||
if false:
|
||||
discard
|
||||
elif false:
|
||||
discard
|
||||
else:
|
||||
discard
|
||||
|
||||
var caseExpr = true
|
||||
case caseExpr
|
||||
of true:
|
||||
discard
|
||||
else:
|
||||
discard
|
||||
|
||||
when sizeof(int) == 2:
|
||||
echo "running on a 16 bit system!"
|
||||
elif sizeof(int) == 4:
|
||||
echo "running on a 32 bit system!"
|
||||
elif sizeof(int) == 8:
|
||||
echo "running on a 64 bit system!"
|
||||
else:
|
||||
echo "cannot happen!"
|
||||
|
||||
while true:
|
||||
break
|
||||
|
||||
var x = 2
|
||||
|
||||
while x != 0:
|
||||
if x == 2:
|
||||
x = 0
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
block testblock:
|
||||
while true:
|
||||
if x > -1:
|
||||
break testblock
|
||||
|
||||
for i in 0 .. 3:
|
||||
discard i
|
||||
Reference in New Issue
Block a user