Skip to content

Commit 1fe23a1

Browse files
committed
adds statements test code
1 parent 95569ae commit 1fe23a1

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

tests/icnif/tencode_node2node.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,4 @@ testNifEncDec(graph, "modtestliterals.nim")
331331
testNifEncDec(graph, "modtesttypesections.nim")
332332
testNifEncDec(graph, "modtestpragmas.nim")
333333
testNifEncDec(graph, "modtestprocs.nim")
334+
testNifEncDec(graph, "modteststatements.nim")
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
var stmtListExpr = (echo "foo"; 111)
2+
3+
if false:
4+
discard
5+
elif false:
6+
discard
7+
else:
8+
discard
9+
10+
var caseExpr = true
11+
case caseExpr
12+
of true:
13+
discard
14+
else:
15+
discard
16+
17+
when sizeof(int) == 2:
18+
echo "running on a 16 bit system!"
19+
elif sizeof(int) == 4:
20+
echo "running on a 32 bit system!"
21+
elif sizeof(int) == 8:
22+
echo "running on a 64 bit system!"
23+
else:
24+
echo "cannot happen!"
25+
26+
while true:
27+
break
28+
29+
var x = 2
30+
31+
while x != 0:
32+
if x == 2:
33+
x = 0
34+
continue
35+
else:
36+
break
37+
38+
block testblock:
39+
while true:
40+
if x > -1:
41+
break testblock
42+
43+
for i in 0 .. 3:
44+
discard i

0 commit comments

Comments
 (0)