summary refs log tree commit diff stats
path: root/tests/sets/tsets2.nim
diff options
context:
space:
mode:
authorMiran <narimiran@users.noreply.github.com>2018-10-16 10:50:10 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-16 10:50:10 +0200
commit749dbce4c69224f5464908d8f714291f17aa60fa (patch)
treecc91326ef536f15d8d9aa97efab4fc8473d093c7 /tests/sets/tsets2.nim
parentf04c93b5dd1ee5e185f6849ad8116d08a687026d (diff)
downloadNim-749dbce4c69224f5464908d8f714291f17aa60fa.tar.gz
Merge tests into a larger file (part 5 of ∞) (#9368)
* merge magics

* merge metatype tests

* merge method tests

* merge objects tests

* change `import future` to `import sugar`

Nim in Action tests are left with `import future`, to ensure compatibility.

* merge overload tests

* merge proc tests

* merge procvar tests

* merge range tests

* merge seq tests

* merge sets tests

* remove wrong assert from `tsets3`

* fix `jsTests`

* better fix
Diffstat (limited to 'tests/sets/tsets2.nim')
-rw-r--r--tests/sets/tsets2.nim71
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/sets/tsets2.nim b/tests/sets/tsets2.nim
deleted file mode 100644
index f28822840..000000000
--- a/tests/sets/tsets2.nim
+++ /dev/null
@@ -1,71 +0,0 @@
-discard """
-  output: '''true'''
-"""
-
-import hashes, sets
-
-const
-  data = [
-    "34", "12",
-    "90", "0",
-    "1", "2",
-    "3", "4",
-    "5", "6",
-    "7", "8",
-    "9", "---00",
-    "10", "11", "19",
-    "20", "30", "40",
-    "50", "60", "70",
-    "80"]
-
-block tableTest1:
-  var t = initSet[tuple[x, y: int]]()
-  t.incl((0,0))
-  t.incl((1,0))
-  assert(not t.containsOrIncl((0,1)))
-  t.incl((1,1))
-
-  for x in 0..1:
-    for y in 0..1:
-      assert((x,y) in t)
-  #assert($t ==
-  #  "{(x: 0, y: 0), (x: 0, y: 1), (x: 1, y: 0), (x: 1, y: 1)}")
-
-block setTest2:
-  var t = initSet[string]()
-  t.incl("test")
-  t.incl("111")
-  t.incl("123")
-  t.excl("111")
-  t.incl("012")
-  t.incl("123") # test duplicates
-
-  assert "123" in t
-  assert "111" notin t # deleted
-
-  assert t.missingOrExcl("000") == true
-  assert "000" notin t
-  assert t.missingOrExcl("012") == false
-  assert "012" notin t
-
-  assert t.containsOrIncl("012") == false 
-  assert t.containsOrIncl("012") == true
-  assert "012" in t # added back 
-
-  for key in items(data): t.incl(key)
-  for key in items(data): assert key in t
-
-  for key in items(data): t.excl(key)
-  for key in items(data): assert key notin t
-
-block orderedSetTest1:
-  var t = data.toOrderedSet
-  for key in items(data): assert key in t
-  var i = 0
-  # `items` needs to yield in insertion order:
-  for key in items(t):
-    assert key == data[i]
-    inc(i)
-
-echo "true"
-