mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
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:
@@ -1,7 +1,3 @@
|
||||
discard """
|
||||
output: '''ok'''
|
||||
"""
|
||||
|
||||
# test file read write in vm
|
||||
|
||||
import os, strutils
|
||||
@@ -24,4 +20,3 @@ static:
|
||||
|
||||
|
||||
removeFile(filename)
|
||||
echo "ok"
|
||||
@@ -1,8 +1,3 @@
|
||||
discard """
|
||||
output: '''@["aaa", "bbb", "ccc"]'''
|
||||
"""
|
||||
|
||||
|
||||
const
|
||||
foo = @["aaa", "bbb", "ccc"]
|
||||
|
||||
@@ -16,4 +11,4 @@ proc myTuple: tuple[n: int, bar: seq[string]] =
|
||||
const
|
||||
(n, bar) = myTuple()
|
||||
|
||||
echo bar
|
||||
doAssert bar == @["aaa", "bbb", "ccc"]
|
||||
@@ -1,8 +1,5 @@
|
||||
# bug #1023
|
||||
|
||||
discard """
|
||||
output: "1 == 1"
|
||||
"""
|
||||
|
||||
type Quadruple = tuple[a, b, c, d: int]
|
||||
|
||||
@@ -14,4 +11,4 @@ const
|
||||
B = (a: 0, b: -2, c: 1, d: 0)
|
||||
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:
|
||||
type Obj = object
|
||||
field: int
|
||||
@@ -48,6 +45,6 @@ proc main =
|
||||
|
||||
var x = 4
|
||||
x = default(int)
|
||||
echo x
|
||||
doAssert x == 0
|
||||
|
||||
main()
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
discard """
|
||||
output: "56"
|
||||
"""
|
||||
|
||||
# bug #1781
|
||||
|
||||
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]
|
||||
|
||||
const combinations = initCombinations()
|
||||
echo combinations[6][10]
|
||||
doAssert combinations[6][10] == 56
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
discard """
|
||||
output: '''-1abc'''
|
||||
"""
|
||||
|
||||
var
|
||||
a {.compileTime.} = 2
|
||||
b = -1
|
||||
@@ -12,4 +8,4 @@ static:
|
||||
doAssert a == 2
|
||||
doAssert c == 3
|
||||
|
||||
echo b, d
|
||||
doAssert ($b & $d) == "-1abc"
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
discard """
|
||||
output: '''success'''
|
||||
"""
|
||||
|
||||
# bug #3804
|
||||
|
||||
#import sequtils
|
||||
@@ -24,5 +20,3 @@ static:
|
||||
# sameBug(objs)
|
||||
echo objs[0].field
|
||||
doAssert(objs[0].field == "hello") # fails, because (objs[0].field == "hello bug") - mutated!
|
||||
|
||||
echo "success"
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
discard """
|
||||
output: "ntWhitespace"
|
||||
"""
|
||||
|
||||
# bug #3357
|
||||
|
||||
type NodeType* = enum
|
||||
@@ -18,4 +14,4 @@ const tokenTypeToNodeType = {
|
||||
ttWhitespace: ntWhitespace,
|
||||
}.enumTable(array[ttWhitespace..ttWhitespace, NodeType])
|
||||
|
||||
echo tokenTypeToNodeType[ttWhitespace]
|
||||
doAssert tokenTypeToNodeType[ttWhitespace] == ntWhitespace
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import macros
|
||||
|
||||
discard """
|
||||
output: '''
|
||||
when - test
|
||||
'''
|
||||
"""
|
||||
|
||||
# test that when stmt works from within a macro
|
||||
|
||||
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
|
||||
more.broken.xs
|
||||
|
||||
echo output("test")
|
||||
doAssert output("test") == "when - test"
|
||||
Reference in New Issue
Block a user