use doAssert in tests (#16486)

This commit is contained in:
flywind 2020-12-28 07:13:21 -06:00 • committed by GitHub
commit 6d442a40a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 1056 additions and 1056 deletions

View file

@ -7,7 +7,7 @@ type Foo = ref object
i: int
proc next(foo: Foo): Option[Foo] =
try: assert(foo.i == 0)
try: doAssert(foo.i == 0)
except: return # 2º: none
return some(foo) # 1º: some
@ -17,6 +17,6 @@ proc test =
while isSome(opt) and foo.i < 10:
inc(foo.i)
opt = next(foo) # 2º None
assert foo.i == 1, $foo.i
doAssert foo.i == 1, $foo.i
test()