diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-12-28 07:13:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-28 14:13:21 +0100 |
commit | 6d442a40a6f89572052d61aeb73ec26d1f3451ce (patch) | |
tree | 6867049dcd37c9610f91e93058580d87b5ca8bb2 /tests/vm | |
parent | f9a15dbae909f4521cd506bedf7ec500c4f4d9f8 (diff) | |
download | Nim-6d442a40a6f89572052d61aeb73ec26d1f3451ce.tar.gz |
use doAssert in tests (#16486)
Diffstat (limited to 'tests/vm')
-rw-r--r-- | tests/vm/tableinstatic.nim | 2 | ||||
-rw-r--r-- | tests/vm/tissues.nim | 2 | ||||
-rw-r--r-- | tests/vm/toverflowopcaddimmint.nim | 2 | ||||
-rw-r--r-- | tests/vm/toverflowopcaddint.nim | 2 | ||||
-rw-r--r-- | tests/vm/toverflowopcmulint.nim | 2 | ||||
-rw-r--r-- | tests/vm/toverflowopcsubimmint.nim | 2 | ||||
-rw-r--r-- | tests/vm/toverflowopcsubint.nim | 2 | ||||
-rw-r--r-- | tests/vm/tstringnil.nim | 2 | ||||
-rw-r--r-- | tests/vm/tvarsection.nim | 4 | ||||
-rw-r--r-- | tests/vm/tvmmisc.nim | 24 | ||||
-rw-r--r-- | tests/vm/twrong_concat.nim | 2 | ||||
-rw-r--r-- | tests/vm/twrongarray.nim | 2 |
12 files changed, 24 insertions, 24 deletions
diff --git a/tests/vm/tableinstatic.nim b/tests/vm/tableinstatic.nim index 4080a5286..934c3a8dd 100644 --- a/tests/vm/tableinstatic.nim +++ b/tests/vm/tableinstatic.nim @@ -35,4 +35,4 @@ static: otherTable["hallo"] = "123" otherTable["welt"] = "456" - assert otherTable == {"hallo": "123", "welt": "456"}.newTable + doAssert otherTable == {"hallo": "123", "welt": "456"}.newTable diff --git a/tests/vm/tissues.nim b/tests/vm/tissues.nim index 063559d2e..1cf3afc00 100644 --- a/tests/vm/tissues.nim +++ b/tests/vm/tissues.nim @@ -25,4 +25,4 @@ block t4952: static: let tree = newTree(nnkExprColonExpr) let t = (n: tree) - assert: t.n.kind == tree.kind + doAssert: t.n.kind == tree.kind diff --git a/tests/vm/toverflowopcaddimmint.nim b/tests/vm/toverflowopcaddimmint.nim index c36b9ed9b..4ff614e5b 100644 --- a/tests/vm/toverflowopcaddimmint.nim +++ b/tests/vm/toverflowopcaddimmint.nim @@ -7,5 +7,5 @@ static: var x = int64.high discard x + 1 - assert false + doAssert false p() diff --git a/tests/vm/toverflowopcaddint.nim b/tests/vm/toverflowopcaddint.nim index 6d96afc78..d494245b1 100644 --- a/tests/vm/toverflowopcaddint.nim +++ b/tests/vm/toverflowopcaddint.nim @@ -8,5 +8,5 @@ static: x = int64.high y = 1 discard x + y - assert false + doAssert false p() diff --git a/tests/vm/toverflowopcmulint.nim b/tests/vm/toverflowopcmulint.nim index 5607c59a7..936eea6c2 100644 --- a/tests/vm/toverflowopcmulint.nim +++ b/tests/vm/toverflowopcmulint.nim @@ -7,5 +7,5 @@ static: var x = 1'i64 shl 62 discard x * 2 - assert false + doAssert false p() diff --git a/tests/vm/toverflowopcsubimmint.nim b/tests/vm/toverflowopcsubimmint.nim index 09d6f745b..08356590c 100644 --- a/tests/vm/toverflowopcsubimmint.nim +++ b/tests/vm/toverflowopcsubimmint.nim @@ -6,5 +6,5 @@ static: proc p = var x = int64.low discard x - 1 - assert false + doAssert false p() diff --git a/tests/vm/toverflowopcsubint.nim b/tests/vm/toverflowopcsubint.nim index 8d114f200..74e34c6a4 100644 --- a/tests/vm/toverflowopcsubint.nim +++ b/tests/vm/toverflowopcsubint.nim @@ -8,5 +8,5 @@ static: x = int64.low y = 1 discard x - y - assert false + doAssert false p() diff --git a/tests/vm/tstringnil.nim b/tests/vm/tstringnil.nim index df408910e..d5dd4f4c9 100644 --- a/tests/vm/tstringnil.nim +++ b/tests/vm/tstringnil.nim @@ -47,4 +47,4 @@ macro suite(suiteName, suiteDesc, suiteBloc: untyped): typed = # Test above suite basics, "Description of such": test(t5, ""): - assert false + doAssert false diff --git a/tests/vm/tvarsection.nim b/tests/vm/tvarsection.nim index d1c4926a0..a45be6164 100644 --- a/tests/vm/tvarsection.nim +++ b/tests/vm/tvarsection.nim @@ -9,7 +9,7 @@ var d = "abc" static: - assert a == 2 - assert c == 3 + doAssert a == 2 + doAssert c == 3 echo b, d diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim index e4d6c308f..005f7e255 100644 --- a/tests/vm/tvmmisc.nim +++ b/tests/vm/tvmmisc.nim @@ -22,11 +22,11 @@ import algorithm static: var numArray = [1, 2, 3, 4, -1] numArray.sort(cmp) - assert numArray == [-1, 1, 2, 3, 4] + doAssert numArray == [-1, 1, 2, 3, 4] var str = "cba" str.sort(cmp) - assert str == "abc" + doAssert str == "abc" # #6086 import math, sequtils, sugar @@ -42,7 +42,7 @@ block: var a = f() const b = f() - assert a == b + doAssert a == b block: proc f(): seq[char] = @@ -50,7 +50,7 @@ block: var runTime = f() const compTime = f() - assert runTime == compTime + doAssert runTime == compTime # #6083 block: @@ -64,24 +64,24 @@ block: result[i] = tmp const fact1000 = abc() - assert fact1000 == @[1, 2] + doAssert fact1000 == @[1, 2] # Tests for VM ops block: static: # for joint test, the project path is different, so I disabled it: when false: - assert "vm" in getProjectPath() + doAssert "vm" in getProjectPath() let b = getEnv("UNSETENVVAR") - assert b == "" - assert existsEnv("UNSERENVVAR") == false + doAssert b == "" + doAssert existsEnv("UNSERENVVAR") == false putEnv("UNSETENVVAR", "VALUE") - assert getEnv("UNSETENVVAR") == "VALUE" - assert existsEnv("UNSETENVVAR") == true + doAssert getEnv("UNSETENVVAR") == "VALUE" + doAssert existsEnv("UNSETENVVAR") == true - assert fileExists("MISSINGFILE") == false - assert dirExists("MISSINGDIR") == false + doAssert fileExists("MISSINGFILE") == false + doAssert dirExists("MISSINGDIR") == false # #7210 block: diff --git a/tests/vm/twrong_concat.nim b/tests/vm/twrong_concat.nim index 538ea2527..b9cca8341 100644 --- a/tests/vm/twrong_concat.nim +++ b/tests/vm/twrong_concat.nim @@ -23,6 +23,6 @@ static: sameBug(objs) # sameBug(objs) echo objs[0].field - assert(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" diff --git a/tests/vm/twrongarray.nim b/tests/vm/twrongarray.nim index c1514d0e9..7f24290e2 100644 --- a/tests/vm/twrongarray.nim +++ b/tests/vm/twrongarray.nim @@ -14,4 +14,4 @@ when false: proc two(dummy: int, size: int) = var x: array[size * 1, int] # compiles, but shouldn't? - #assert(x.len == size) # just for fun + # doAssert(x.len == size) # just for fun |