diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-08-24 01:28:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 19:28:51 +0200 |
commit | 3dbf2ac9469bdaaf876f902242a883fe1847adf0 (patch) | |
tree | 50f81be04f7d218be0c29d4803662a38df925237 | |
parent | 1182216381cdd17b75e16133ce2c79084dd3d3f9 (diff) | |
download | Nim-3dbf2ac9469bdaaf876f902242a883fe1847adf0.tar.gz |
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>
-rw-r--r-- | tests/vm/tfile_rw.nim | 5 | ||||
-rw-r--r-- | tests/vm/tnewseqofcap.nim | 7 | ||||
-rw-r--r-- | tests/vm/tquadplus.nim | 5 | ||||
-rw-r--r-- | tests/vm/treset.nim | 5 | ||||
-rw-r--r-- | tests/vm/triangle_array.nim | 6 | ||||
-rw-r--r-- | tests/vm/tvarsection.nim | 6 | ||||
-rw-r--r-- | tests/vm/twrong_concat.nim | 6 | ||||
-rw-r--r-- | tests/vm/tyaytypedesc.nim | 6 | ||||
-rw-r--r-- | tests/whenstmt/twhen_macro.nim | 8 |
9 files changed, 7 insertions, 47 deletions
diff --git a/tests/vm/tfile_rw.nim b/tests/vm/tfile_rw.nim index 8d7a2ca95..439886e49 100644 --- a/tests/vm/tfile_rw.nim +++ b/tests/vm/tfile_rw.nim @@ -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" \ No newline at end of file diff --git a/tests/vm/tnewseqofcap.nim b/tests/vm/tnewseqofcap.nim index c61c3c485..a7dc07aa6 100644 --- a/tests/vm/tnewseqofcap.nim +++ b/tests/vm/tnewseqofcap.nim @@ -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 \ No newline at end of file +doAssert bar == @["aaa", "bbb", "ccc"] \ No newline at end of file diff --git a/tests/vm/tquadplus.nim b/tests/vm/tquadplus.nim index 552e8fef7..acf20cd96 100644 --- a/tests/vm/tquadplus.nim +++ b/tests/vm/tquadplus.nim @@ -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" diff --git a/tests/vm/treset.nim b/tests/vm/treset.nim index ff8bc5b83..32fbc7f04 100644 --- a/tests/vm/treset.nim +++ b/tests/vm/treset.nim @@ -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() diff --git a/tests/vm/triangle_array.nim b/tests/vm/triangle_array.nim index 054c66f22..0704239c6 100644 --- a/tests/vm/triangle_array.nim +++ b/tests/vm/triangle_array.nim @@ -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 diff --git a/tests/vm/tvarsection.nim b/tests/vm/tvarsection.nim index a45be6164..cd34bd02e 100644 --- a/tests/vm/tvarsection.nim +++ b/tests/vm/tvarsection.nim @@ -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" diff --git a/tests/vm/twrong_concat.nim b/tests/vm/twrong_concat.nim index b9cca8341..59a10bdb9 100644 --- a/tests/vm/twrong_concat.nim +++ b/tests/vm/twrong_concat.nim @@ -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" diff --git a/tests/vm/tyaytypedesc.nim b/tests/vm/tyaytypedesc.nim index aab94d643..8cb402bff 100644 --- a/tests/vm/tyaytypedesc.nim +++ b/tests/vm/tyaytypedesc.nim @@ -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 diff --git a/tests/whenstmt/twhen_macro.nim b/tests/whenstmt/twhen_macro.nim index b5168144e..deb1dddc9 100644 --- a/tests/whenstmt/twhen_macro.nim +++ b/tests/whenstmt/twhen_macro.nim @@ -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") \ No newline at end of file +doAssert output("test") == "when - test" \ No newline at end of file |