new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
28
tests/controlflow/tcontinue.nim
Normal file
28
tests/controlflow/tcontinue.nim
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
discard """
|
||||
output: "came here"
|
||||
"""
|
||||
|
||||
var i = 0
|
||||
while i < 400:
|
||||
|
||||
if i == 10: break
|
||||
elif i == 3:
|
||||
inc i
|
||||
continue
|
||||
inc i
|
||||
|
||||
var f = "failure"
|
||||
var j = 0
|
||||
while j < 300:
|
||||
for x in 0..34:
|
||||
if j < 300: continue
|
||||
if x == 10:
|
||||
echo "failure: should never happen"
|
||||
break
|
||||
f = "came here"
|
||||
break
|
||||
|
||||
if i == 10:
|
||||
echo f
|
||||
else:
|
||||
echo "failure"
|
||||
12
tests/controlflow/tstatret.nim
Normal file
12
tests/controlflow/tstatret.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
file: "tstatret.nim"
|
||||
line: 9
|
||||
errormsg: "statement not allowed after"
|
||||
"""
|
||||
# no statement after return
|
||||
proc main() =
|
||||
return
|
||||
echo("huch?") #ERROR_MSG statement not allowed after
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue