summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-28 07:13:21 -0600
committerGitHub <noreply@github.com>2020-12-28 14:13:21 +0100
commit6d442a40a6f89572052d61aeb73ec26d1f3451ce (patch)
tree6867049dcd37c9610f91e93058580d87b5ca8bb2 /tests/vm
parentf9a15dbae909f4521cd506bedf7ec500c4f4d9f8 (diff)
downloadNim-6d442a40a6f89572052d61aeb73ec26d1f3451ce.tar.gz
use doAssert in tests (#16486)
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tableinstatic.nim2
-rw-r--r--tests/vm/tissues.nim2
-rw-r--r--tests/vm/toverflowopcaddimmint.nim2
-rw-r--r--tests/vm/toverflowopcaddint.nim2
-rw-r--r--tests/vm/toverflowopcmulint.nim2
-rw-r--r--tests/vm/toverflowopcsubimmint.nim2
-rw-r--r--tests/vm/toverflowopcsubint.nim2
-rw-r--r--tests/vm/tstringnil.nim2
-rw-r--r--tests/vm/tvarsection.nim4
-rw-r--r--tests/vm/tvmmisc.nim24
-rw-r--r--tests/vm/twrong_concat.nim2
-rw-r--r--tests/vm/twrongarray.nim2
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
Andreas Rumpf <andreas@andreas-desktop> 2009-12-14 01:38:05 +0100 floating point checks' href='/ahoang/Nim/commit/config/nimrod.cfg?h=devel&id=3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b'>3b7ef2288 ^
c8d270268 ^
a7e9ae55f ^


3b7ef2288 ^
0f0dfd637 ^
3b7ef2288 ^
c4ca19d83 ^
78f4aacde ^
4105a91c4 ^
9604df843 ^
3b7ef2288 ^
4105a91c4 ^
9604df843 ^
3b7ef2288 ^
4105a91c4 ^
3b7ef2288 ^

4105a91c4 ^




3b7ef2288 ^







220dd54ac ^





3b7ef2288 ^
b7e8daf65 ^
446b04218 ^
3b7ef2288 ^










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141