improve tests for collections (#16328)
* improve tests for collections * remove remaining code blocks in deques.nim * improve runnableExamples
This commit is contained in:
parent
0b73106ccf
commit
b1c232aca1
6 changed files with 227 additions and 242 deletions
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
targets: "c js"
|
||||
"""
|
||||
|
||||
import std/[sequtils,critbits]
|
||||
|
||||
template main =
|
||||
|
|
@ -65,5 +69,19 @@ template main =
|
|||
discard strings.containsOrIncl("foo", 3)
|
||||
doAssert strings["foo"] == 3
|
||||
|
||||
block tcritbitsToString:
|
||||
block:
|
||||
var t: CritBitTree[int]
|
||||
t["a"] = 1
|
||||
doAssert $t == """{"a": 1}"""
|
||||
block:
|
||||
var t: CritBitTree[string]
|
||||
t["a"] = "1"
|
||||
doAssert $t == """{"a": "1"}"""
|
||||
block:
|
||||
var t: CritBitTree[char]
|
||||
t["a"] = '1'
|
||||
doAssert $t == """{"a": '1'}"""
|
||||
|
||||
main()
|
||||
static: main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue