summary refs log tree commit diff stats
path: root/tests/compile/tcompiles.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-07-20 08:49:42 +0200
committerAraq <rumpf_a@web.de>2012-07-20 08:49:42 +0200
commit1c6f14deeeb3dc6acb41efba886e4999a8621a4a (patch)
treefc7d16bef573ed2423bc8961f9b6ebba681ea4ed /tests/compile/tcompiles.nim
parent43f057c5aa23cf2cc441906737cd53fda90811c7 (diff)
downloadNim-1c6f14deeeb3dc6acb41efba886e4999a8621a4a.tar.gz
added system.compiles
Diffstat (limited to 'tests/compile/tcompiles.nim')
-rw-r--r--tests/compile/tcompiles.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/compile/tcompiles.nim b/tests/compile/tcompiles.nim
new file mode 100644
index 000000000..4b72d8bd8
--- /dev/null
+++ b/tests/compile/tcompiles.nim
@@ -0,0 +1,12 @@
+discard """
+  output: '''no'''
+"""
+
+# test the new 'compiles' feature:
+
+when compiles(4+5.0 * "hallo"):
+  echo "yes"
+else:
+  echo "no"
+  
+