require errormsg to be specified before file.
This commit is contained in:
parent
ca394ebd95
commit
1105d03644
264 changed files with 305 additions and 623 deletions
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tcountup.nim"
|
||||
output: "0123456789"
|
||||
"""
|
||||
|
||||
|
|
@ -9,6 +8,3 @@ for i in 0 .. < 10'i64:
|
|||
stdout.write(i)
|
||||
|
||||
#OUT 0123456789
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
file: "titer11.nim"
|
||||
output: '''[
|
||||
output: '''
|
||||
[
|
||||
1
|
||||
2
|
||||
3
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "titer3.nim"
|
||||
output: '''1231
|
||||
4
|
||||
6
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
discard """
|
||||
errormsg: "iterator within for loop context expected"
|
||||
file: "titer4.nim"
|
||||
line: 7
|
||||
errormsg: "iterator within for loop context expected"
|
||||
"""
|
||||
# implicit items/pairs, but not if we have 3 for loop vars:
|
||||
for x, y, z in {'a'..'z'}: #ERROR_MSG iterator within for loop context expected
|
||||
nil
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "titer5.nim"
|
||||
output: "abcxyz"
|
||||
"""
|
||||
# Test method call syntax for iterators:
|
||||
|
|
@ -11,6 +10,3 @@ for x in lines.split():
|
|||
stdout.write(x)
|
||||
|
||||
#OUT abcxyz
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "titer6.nim"
|
||||
output: "000"
|
||||
"""
|
||||
# Test iterator with more than 1 yield statement
|
||||
|
|
@ -32,6 +31,3 @@ proc wordWrap2(s: string, maxLineWidth = 80,
|
|||
result = ""
|
||||
for word, isSep in tokenize2(s, seps):
|
||||
var w = 0
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "titer2.nim"
|
||||
output: "123"
|
||||
"""
|
||||
# Try to break the transformation pass:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
discard """
|
||||
errormsg: "recursive dependency: \'myrec\'"
|
||||
file: "treciter.nim"
|
||||
line: 9
|
||||
errormsg: "recursive dependency: \'myrec\'"
|
||||
"""
|
||||
# Test that an error message occurs for a recursive iterator
|
||||
|
||||
|
|
@ -10,5 +10,3 @@ iterator myrec(n: int): int =
|
|||
yield x
|
||||
|
||||
for x in myrec(10): echo x
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
line: 12
|
||||
errormsg: "type mismatch"
|
||||
line: 12
|
||||
"""
|
||||
|
||||
proc first(it: iterator(): int): seq[int] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue