summary refs log tree commit diff stats
path: root/tests/collections/tindexby.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/collections/tindexby.nim')
-rw-r--r--tests/collections/tindexby.nim22
1 files changed, 0 insertions, 22 deletions
diff --git a/tests/collections/tindexby.nim b/tests/collections/tindexby.nim
deleted file mode 100644
index 88c0b263e..000000000
--- a/tests/collections/tindexby.nim
+++ /dev/null
@@ -1,22 +0,0 @@
-import tables
-
-doAssert indexBy(newSeq[int](), proc(x: int):int = x) == initTable[int, int](), "empty int table"
-
-var tbl1 = initTable[int, int]()
-tbl1.add(1,1)
-tbl1.add(2,2)
-doAssert indexBy(@[1,2], proc(x: int):int = x) == tbl1, "int table"
-
-type
-  TElem = object
-    foo: int
-    bar: string
-
-let
-  elem1 = TElem(foo: 1, bar: "bar")
-  elem2 = TElem(foo: 2, bar: "baz")
-
-var tbl2 = initTable[string, TElem]()
-tbl2.add("bar", elem1)
-tbl2.add("baz", elem2)
-doAssert indexBy(@[elem1,elem2], proc(x: TElem): string = x.bar) == tbl2, "element table"