remove echo statements in tests (part 1) (#20178)
* remove echo statements * Update tests/vm/triangle_array.nim * Update tests/vm/tyaytypedesc.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
parent
1182216381
commit
3dbf2ac946
9 changed files with 7 additions and 47 deletions
|
|
@ -1,7 +1,3 @@
|
||||||
discard """
|
|
||||||
output: '''ok'''
|
|
||||||
"""
|
|
||||||
|
|
||||||
# test file read write in vm
|
# test file read write in vm
|
||||||
|
|
||||||
import os, strutils
|
import os, strutils
|
||||||
|
|
@ -24,4 +20,3 @@ static:
|
||||||
|
|
||||||
|
|
||||||
removeFile(filename)
|
removeFile(filename)
|
||||||
echo "ok"
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
discard """
|
|
||||||
output: '''@["aaa", "bbb", "ccc"]'''
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
foo = @["aaa", "bbb", "ccc"]
|
foo = @["aaa", "bbb", "ccc"]
|
||||||
|
|
||||||
|
|
@ -16,4 +11,4 @@ proc myTuple: tuple[n: int, bar: seq[string]] =
|
||||||
const
|
const
|
||||||
(n, bar) = myTuple()
|
(n, bar) = myTuple()
|
||||||
|
|
||||||
echo bar
|
doAssert bar == @["aaa", "bbb", "ccc"]
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
# bug #1023
|
# bug #1023
|
||||||
|
|
||||||
discard """
|
|
||||||
output: "1 == 1"
|
|
||||||
"""
|
|
||||||
|
|
||||||
type Quadruple = tuple[a, b, c, d: int]
|
type Quadruple = tuple[a, b, c, d: int]
|
||||||
|
|
||||||
|
|
@ -14,4 +11,4 @@ const
|
||||||
B = (a: 0, b: -2, c: 1, d: 0)
|
B = (a: 0, b: -2, c: 1, d: 0)
|
||||||
C = A + B
|
C = A + B
|
||||||
|
|
||||||
echo C.d, " == ", (A+B).d
|
doAssert $C.d & " == " & $(A+B).d == "1 == 1"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
discard """
|
|
||||||
output: '''0'''
|
|
||||||
"""
|
|
||||||
static:
|
static:
|
||||||
type Obj = object
|
type Obj = object
|
||||||
field: int
|
field: int
|
||||||
|
|
@ -48,6 +45,6 @@ proc main =
|
||||||
|
|
||||||
var x = 4
|
var x = 4
|
||||||
x = default(int)
|
x = default(int)
|
||||||
echo x
|
doAssert x == 0
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
discard """
|
|
||||||
output: "56"
|
|
||||||
"""
|
|
||||||
|
|
||||||
# bug #1781
|
# bug #1781
|
||||||
|
|
||||||
proc initCombinations: array[11, array[11, int]] =
|
proc initCombinations: array[11, array[11, int]] =
|
||||||
|
|
@ -14,4 +10,4 @@ proc initCombinations: array[11, array[11, int]] =
|
||||||
result[6][6 .. 10] = [52,53,54,55,56]
|
result[6][6 .. 10] = [52,53,54,55,56]
|
||||||
|
|
||||||
const combinations = initCombinations()
|
const combinations = initCombinations()
|
||||||
echo combinations[6][10]
|
doAssert combinations[6][10] == 56
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
discard """
|
|
||||||
output: '''-1abc'''
|
|
||||||
"""
|
|
||||||
|
|
||||||
var
|
var
|
||||||
a {.compileTime.} = 2
|
a {.compileTime.} = 2
|
||||||
b = -1
|
b = -1
|
||||||
|
|
@ -12,4 +8,4 @@ static:
|
||||||
doAssert a == 2
|
doAssert a == 2
|
||||||
doAssert c == 3
|
doAssert c == 3
|
||||||
|
|
||||||
echo b, d
|
doAssert ($b & $d) == "-1abc"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
discard """
|
|
||||||
output: '''success'''
|
|
||||||
"""
|
|
||||||
|
|
||||||
# bug #3804
|
# bug #3804
|
||||||
|
|
||||||
#import sequtils
|
#import sequtils
|
||||||
|
|
@ -24,5 +20,3 @@ static:
|
||||||
# sameBug(objs)
|
# sameBug(objs)
|
||||||
echo objs[0].field
|
echo objs[0].field
|
||||||
doAssert(objs[0].field == "hello") # fails, because (objs[0].field == "hello bug") - mutated!
|
doAssert(objs[0].field == "hello") # fails, because (objs[0].field == "hello bug") - mutated!
|
||||||
|
|
||||||
echo "success"
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
discard """
|
|
||||||
output: "ntWhitespace"
|
|
||||||
"""
|
|
||||||
|
|
||||||
# bug #3357
|
# bug #3357
|
||||||
|
|
||||||
type NodeType* = enum
|
type NodeType* = enum
|
||||||
|
|
@ -18,4 +14,4 @@ const tokenTypeToNodeType = {
|
||||||
ttWhitespace: ntWhitespace,
|
ttWhitespace: ntWhitespace,
|
||||||
}.enumTable(array[ttWhitespace..ttWhitespace, NodeType])
|
}.enumTable(array[ttWhitespace..ttWhitespace, NodeType])
|
||||||
|
|
||||||
echo tokenTypeToNodeType[ttWhitespace]
|
doAssert tokenTypeToNodeType[ttWhitespace] == ntWhitespace
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
import macros
|
import macros
|
||||||
|
|
||||||
discard """
|
|
||||||
output: '''
|
|
||||||
when - test
|
|
||||||
'''
|
|
||||||
"""
|
|
||||||
|
|
||||||
# test that when stmt works from within a macro
|
# test that when stmt works from within a macro
|
||||||
|
|
||||||
macro output(s: string, xs: varargs[untyped]): auto =
|
macro output(s: string, xs: varargs[untyped]): auto =
|
||||||
|
|
@ -21,4 +15,4 @@ macro output(s: string, xs: varargs[untyped]): auto =
|
||||||
# should never get here so this should not break
|
# should never get here so this should not break
|
||||||
more.broken.xs
|
more.broken.xs
|
||||||
|
|
||||||
echo output("test")
|
doAssert output("test") == "when - test"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue