Turn some test outputs into actual tests
This commit is contained in:
parent
c433ae1aaa
commit
22db40e5e4
13 changed files with 84 additions and 52 deletions
|
|
@ -286,6 +286,8 @@ proc `$`*[T](c: CritBitTree[T]): string =
|
|||
result.add("}")
|
||||
|
||||
when isMainModule:
|
||||
import sequtils
|
||||
|
||||
var r: CritBitTree[void]
|
||||
r.incl "abc"
|
||||
r.incl "xyz"
|
||||
|
|
@ -295,12 +297,8 @@ when isMainModule:
|
|||
|
||||
doAssert r.contains"def"
|
||||
|
||||
when not defined(testing):
|
||||
#r.del "def"
|
||||
r.excl "def"
|
||||
|
||||
for w in r.items:
|
||||
echo w
|
||||
|
||||
for w in r.itemsWithPrefix("de"):
|
||||
echo w
|
||||
assert toSeq(r.items) == @["abc", "definition", "prefix", "xyz"]
|
||||
|
||||
assert toSeq(r.itemsWithPrefix("de")) == @["definition"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue