Testament: refactoring; makes the test joiner green
This commit is contained in:
parent
8896770f8f
commit
3b783f7e13
28 changed files with 176 additions and 230 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -10,3 +10,4 @@ for x in lines.split():
|
|||
stdout.write(x)
|
||||
|
||||
#OUT abcxyz
|
||||
stdout.write "\n"
|
||||
|
|
|
|||
|
|
@ -31,3 +31,5 @@ proc wordWrap2(s: string, maxLineWidth = 80,
|
|||
result = ""
|
||||
for word, isSep in tokenize2(s, seps):
|
||||
var w = 0
|
||||
|
||||
stdout.write "\n"
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue