summary refs log tree commit diff stats
path: root/tests/ic
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-08-08 08:41:05 +0200
committerGitHub <noreply@github.com>2019-08-08 08:41:05 +0200
commitc8cffaf42037ae8defe59d9a1fb7d202655aa1ee (patch)
treed9bf11748ee18dccf00fefb2f3d6aaeff8e115ff /tests/ic
parentc0d240b8cd3dc08d25c671b0dc7614fbfa980c2e (diff)
downloadNim-c8cffaf42037ae8defe59d9a1fb7d202655aa1ee.tar.gz
Incremental compilation (IC): Improvements (#11881)
* IC: C codegen is aware of IC
* manual: minor change to make VSCode's RST plugin render it properly
* IC: minor refactoring
* testament: code refactorings
* rodutils: removed dead code
* IC: always build the compiler with the IC feature
* IC: C codegen improvements
* IC: implement the undocumented -d:nimMustCache option for testing purposes
* IC: added first basic tests
* IC: extensive testing of the deserialization feature
* testament: refactoring; better IC tests
* IC: removes 'nimMustCache' flag; readonly does the same
* testament: minor refactoring
* update Nimble version
* testament: removed dead code and imports; IC: added simple test
* IC: progress
Diffstat (limited to 'tests/ic')
-rw-r--r--tests/ic/tgenerics.nim39
-rw-r--r--tests/ic/thallo.nim28
2 files changed, 67 insertions, 0 deletions
diff --git a/tests/ic/tgenerics.nim b/tests/ic/tgenerics.nim
new file mode 100644
index 000000000..bc5c05f4f
--- /dev/null
+++ b/tests/ic/tgenerics.nim
@@ -0,0 +1,39 @@
+discard """
+  output: "bar"
+  disabled: "true"
+"""
+
+import tables
+
+var tab: Table[string, string]
+
+tab["foo"] = "bar"
+echo tab["foo"]
+
+#!EDIT!#
+
+discard """
+  output: "bar 3"
+"""
+
+import tables
+
+var tab: Table[string, string]
+var tab2: Table[string, int]
+
+tab["foo"] = "bar"
+tab2["meh"] = 3
+echo tab["foo"], " ", tab2["meh"]
+
+#!EDIT!#
+
+discard """
+  output: "3"
+"""
+
+import tables
+
+var tab2: Table[string, int]
+
+tab2["meh"] = 3
+echo tab2["meh"]
diff --git a/tests/ic/thallo.nim b/tests/ic/thallo.nim
new file mode 100644
index 000000000..7ead7c8ba
--- /dev/null
+++ b/tests/ic/thallo.nim
@@ -0,0 +1,28 @@
+discard """
+  output: "Hello World"
+"""
+
+const str = "Hello World"
+echo str
+
+# Splitters are done with this special comment:
+
+#!EDIT!#
+
+discard """
+  output: "Hello World B"
+"""
+
+const str = "Hello World"
+echo str, " B"
+
+#!EDIT!#
+
+discard """
+  output: "Hello World C"
+"""
+
+const str = "Hello World"
+var x = 7
+if 3+4 == x:
+  echo str, " C"