Testament: refactoring; makes the test joiner green

This commit is contained in:
Araq 2018-12-06 16:37:56 +01:00
commit 3b783f7e13
28 changed files with 176 additions and 230 deletions

View file

@ -2,9 +2,8 @@ discard """
output: "0123456789"
"""
# Test new countup and unary <
# Test new countup
for i in 0 .. < 10'i64:
for i in 0 ..< 10'i64:
stdout.write(i)
#OUT 0123456789
echo "\n"

View file

@ -10,3 +10,4 @@ for x in lines.split():
stdout.write(x)
#OUT abcxyz
stdout.write "\n"

View file

@ -31,3 +31,5 @@ proc wordWrap2(s: string, maxLineWidth = 80,
result = ""
for word, isSep in tokenize2(s, seps):
var w = 0
stdout.write "\n"

View file

@ -45,9 +45,9 @@ proc square(x:int): int =
let list = @[1,2,3,4,5,6,7,8,9]
echo ("--- evens")
for item in list / isEven : echo(item)
for item in list / isEven: echo(item)
echo ("--- squares")
for item in list >> square : echo(item)
for item in list >> square: echo(item)
#echo ("--- squares of evens, only")
# next line doesn't compile. Generic types are not inferred
#for item in list />> (isEven, square) : echo(item)

View file

@ -10,3 +10,5 @@ iterator iterAndZero(a: var openArray[int]): int =
var x = [[1, 2, 3], [4, 5, 6]]
for y in iterAndZero(x[0]): write(stdout, $y)
#OUT 123
write stdout, "\n"