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,5 +1,5 @@
|
|||
discard """
|
||||
output: '''true'''
|
||||
targets: "c js"
|
||||
"""
|
||||
|
||||
import lists
|
||||
|
|
@ -62,6 +62,22 @@ block DoublyLinkedRingTest1:
|
|||
assert($L == "[]")
|
||||
assert(4 notin L)
|
||||
|
||||
|
||||
echo "true"
|
||||
|
||||
block tlistsToString:
|
||||
block:
|
||||
var l = initDoublyLinkedList[int]()
|
||||
l.append(1)
|
||||
l.append(2)
|
||||
l.append(3)
|
||||
doAssert $l == "[1, 2, 3]"
|
||||
block:
|
||||
var l = initDoublyLinkedList[string]()
|
||||
l.append("1")
|
||||
l.append("2")
|
||||
l.append("3")
|
||||
doAssert $l == """["1", "2", "3"]"""
|
||||
block:
|
||||
var l = initDoublyLinkedList[char]()
|
||||
l.append('1')
|
||||
l.append('2')
|
||||
l.append('3')
|
||||
doAssert $l == """['1', '2', '3']"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue