mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-30 02:21:43 +00:00
make run the default action of a test in tester
This commit is contained in:
@@ -15,4 +15,4 @@ iterator fields(a = (0,0), b = (h-1,w-1)): auto =
|
||||
yield (y,x)
|
||||
|
||||
for y,x in fields():
|
||||
stdout.write disp[univ(x, y)]
|
||||
doAssert disp[univ(x, y)] == disp[Tree]
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
discard """
|
||||
output: '''
|
||||
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest2!test3?hi
|
||||
what's
|
||||
your
|
||||
name
|
||||
hi
|
||||
what's
|
||||
your
|
||||
name
|
||||
'''
|
||||
"""
|
||||
|
||||
# Test the new iterators
|
||||
|
||||
iterator xrange(fromm, to: int, step = 1): int =
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
discard """
|
||||
output: '''
|
||||
3 4
|
||||
4 5
|
||||
5 6
|
||||
6 7
|
||||
7 8
|
||||
(x: 3, y: 4)
|
||||
(x: 4, y: 5)
|
||||
(x: 5, y: 6)
|
||||
(x: 6, y: 7)
|
||||
(x: 7, y: 8)
|
||||
'''
|
||||
"""
|
||||
|
||||
|
||||
iterator xrange(fromm, to: int, step = 1): tuple[x, y: int] =
|
||||
var a = fromm
|
||||
@@ -10,4 +25,3 @@ for a, b in xrange(3, 7):
|
||||
|
||||
for tup in xrange(3, 7):
|
||||
echo tup
|
||||
|
||||
|
||||
@@ -11,6 +11,3 @@ 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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
discard """
|
||||
output: '''
|
||||
@[@[1.0, 2.0], @[3.0, 4.0]]
|
||||
perm: 10.0 det: -2.0
|
||||
@[@[1.0, 2.0, 3.0, 4.0], @[4.0, 5.0, 6.0, 7.0], @[7.0, 8.0, 9.0, 10.0], @[10.0, 11.0, 12.0, 13.0]]
|
||||
perm: 29556.0 det: 0.0
|
||||
@[@[0.0, 1.0, 2.0, 3.0, 4.0], @[5.0, 6.0, 7.0, 8.0, 9.0], @[10.0, 11.0, 12.0, 13.0, 14.0], @[15.0, 16.0, 17.0, 18.0, 19.0], @[20.0, 21.0, 22.0, 23.0, 24.0]]
|
||||
perm: 6778800.0 det: 0.0
|
||||
'''
|
||||
"""
|
||||
|
||||
|
||||
import sequtils, sugar
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
discard """
|
||||
ccodecheck: "!@('{' \\s* 'NI HEX3Astate;' \\s* '}')"
|
||||
output: '''
|
||||
a1 10
|
||||
a1 9
|
||||
'''
|
||||
"""
|
||||
|
||||
# bug #1803
|
||||
@@ -26,6 +30,6 @@ var
|
||||
z: TaskFn
|
||||
|
||||
discard x()
|
||||
z = x #shallowCopy(z, x)
|
||||
z = y #shallowCopy(z, y)
|
||||
shallowCopy(z, x)
|
||||
shallowCopy(z, y)
|
||||
discard x()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
|
||||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
|
||||
Reference in New Issue
Block a user