use doAssert in tests (#16486)
This commit is contained in:
parent
f9a15dbae9
commit
6d442a40a6
78 changed files with 1056 additions and 1056 deletions
|
|
@ -17,14 +17,14 @@ Val1
|
|||
|
||||
import macros
|
||||
|
||||
template ok(x) = assert(x)
|
||||
template no(x) = assert(not x)
|
||||
template ok(x) = doAssert(x)
|
||||
template no(x) = doAssert(not x)
|
||||
|
||||
template accept(x) =
|
||||
static: assert(compiles(x))
|
||||
static: doAssert(compiles(x))
|
||||
|
||||
template reject(x) =
|
||||
static: assert(not compiles(x))
|
||||
static: doAssert(not compiles(x))
|
||||
|
||||
proc plus(a, b: int): int = a + b
|
||||
|
||||
|
|
@ -54,8 +54,8 @@ when true:
|
|||
b: static[int],
|
||||
c: static int) =
|
||||
static:
|
||||
assert a.isStatic and b.isStatic and c.isStatic
|
||||
assert isStatic(a + plus(b, c))
|
||||
doAssert a.isStatic and b.isStatic and c.isStatic
|
||||
doAssert isStatic(a + plus(b, c))
|
||||
echo "staticAlialProc instantiated with ", a, b, c
|
||||
|
||||
when b mod a == 0:
|
||||
|
|
@ -111,9 +111,9 @@ when true:
|
|||
var aw3: ArrayWrapper3[(10, "str")]
|
||||
|
||||
static:
|
||||
assert aw1.data.high == 5
|
||||
assert aw2.data.high == 6
|
||||
assert aw3.data.high == 9
|
||||
doAssert aw1.data.high == 5
|
||||
doAssert aw2.data.high == 6
|
||||
doAssert aw3.data.high == 9
|
||||
|
||||
# #6077
|
||||
block:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue