diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-02-01 10:21:58 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-02-01 10:21:58 +0100 |
commit | 9bd72fc0d96c1ce2e0c162b446346ec0e39712e2 (patch) | |
tree | 1f24cb41830d4aa21662932dc884f7b1373ab119 /tests | |
parent | 2780e7a54a28ebb87982abbb4a5b0e1ccfe31451 (diff) | |
parent | 11a5a4a9a6a573d5c80c583584323036c72cd691 (diff) | |
download | Nim-9bd72fc0d96c1ce2e0c162b446346ec0e39712e2.tar.gz |
Merge pull request #2037 from def-/fix-lists
Fix SinglyLinkedRing in lists module
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/tsinglylinkedring.nim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/stdlib/tsinglylinkedring.nim b/tests/stdlib/tsinglylinkedring.nim new file mode 100644 index 000000000..93f0c69cd --- /dev/null +++ b/tests/stdlib/tsinglylinkedring.nim @@ -0,0 +1,29 @@ +discard """ + output: '''[5] +[4, 5] +[3, 4, 5] +[2, 3, 4, 5] +[2, 3, 4, 5, 6] +[2, 3, 4, 5, 6, 7] +[2, 3, 4, 5, 6, 7, 8] +[1, 2, 3, 4, 5, 6, 7, 8]''' +""" +import lists + +var r = initSinglyLinkedRing[int]() +r.prepend(5) +echo r +r.prepend(4) +echo r +r.prepend(3) +echo r +r.prepend(2) +echo r +r.append(6) +echo r +r.append(7) +echo r +r.append(8) +echo r +r.prepend(1) +echo r |