summary refs log tree commit diff stats
path: root/tests/ic
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-04-09 16:41:49 +0200
committerGitHub <noreply@github.com>2021-04-09 16:41:49 +0200
commit1822ed384abdbbb5d385b1ad24e23e66936dbf74 (patch)
tree272e9c20bd9464867ec25cba060468a671dacbe0 /tests/ic
parent8aa5991beaa01f25a90d4115ed2495c92221f603 (diff)
downloadNim-1822ed384abdbbb5d385b1ad24e23e66936dbf74.tar.gz
IC: added converter test case (#17688)
* IC: added converter test case

* IC: make converter example work
Diffstat (limited to 'tests/ic')
-rw-r--r--tests/ic/mdefconverter.nim2
-rw-r--r--tests/ic/tconverter.nim18
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/ic/mdefconverter.nim b/tests/ic/mdefconverter.nim
new file mode 100644
index 000000000..d0a23f801
--- /dev/null
+++ b/tests/ic/mdefconverter.nim
@@ -0,0 +1,2 @@
+
+converter toBool*(x: int): bool = x != 0
diff --git a/tests/ic/tconverter.nim b/tests/ic/tconverter.nim
new file mode 100644
index 000000000..aecdf4b48
--- /dev/null
+++ b/tests/ic/tconverter.nim
@@ -0,0 +1,18 @@
+discard """
+  output: "yes"
+"""
+
+import mdefconverter
+
+echo "yes"
+
+#!EDIT!#
+
+discard """
+  output: "converted int to bool"
+"""
+
+import mdefconverter
+
+if 4:
+  echo "converted int to bool"