diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/rodfiles/tgeneric1.nim | 13 | ||||
-rw-r--r-- | tests/rodfiles/tgeneric2.nim | 13 | ||||
-rwxr-xr-x | tests/tester.nim | 4 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/rodfiles/tgeneric1.nim b/tests/rodfiles/tgeneric1.nim new file mode 100644 index 000000000..a3f7b870b --- /dev/null +++ b/tests/rodfiles/tgeneric1.nim @@ -0,0 +1,13 @@ +discard """ + output: "abcd" +""" + +import tables + +var x = initTable[int, string]() + +x[2] = "ab" +x[5] = "cd" + +echo x[2], x[5] + diff --git a/tests/rodfiles/tgeneric2.nim b/tests/rodfiles/tgeneric2.nim new file mode 100644 index 000000000..552d60267 --- /dev/null +++ b/tests/rodfiles/tgeneric2.nim @@ -0,0 +1,13 @@ +discard """ + output: "abef" +""" + +import tables + +var x = initTable[int, string]() + +x[2] = "ab" +x[5] = "ef" + +echo x[2], x[5] + diff --git a/tests/tester.nim b/tests/tester.nim index 071561b30..9bf16d84d 100755 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -309,6 +309,10 @@ proc runRodFiles(r: var TResults, options: string) = test "bmethods2.nim" delNimCache() + # test generics: + test "tgeneric1.nim" + test "tgeneric2.nim" + delNimCache() proc compileRodFiles(r: var TResults, options: string) = template test(filename: expr): stmt = |