summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-06 01:11:38 +0100
committerAraq <rumpf_a@web.de>2011-11-06 01:11:38 +0100
commit089e287c6e95edab56e610f7a615933e42aaff52 (patch)
tree8ccb6c1937af7651de369b5bbe7d828b8877f409 /tests
parentdc08a033d910aea19fde0f59c9d1a5e70d7efc15 (diff)
downloadNim-089e287c6e95edab56e610f7a615933e42aaff52.tar.gz
compilation cache: fixed recently introduced bug (lazy loading of bodies)
Diffstat (limited to 'tests')
-rw-r--r--tests/rodfiles/tgeneric1.nim13
-rw-r--r--tests/rodfiles/tgeneric2.nim13
-rwxr-xr-xtests/tester.nim4
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 =