summary refs log tree commit diff stats
path: root/tests/run/tlet.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-29 17:27:48 +0100
committerAraq <rumpf_a@web.de>2011-11-29 17:27:48 +0100
commit7fcbdc6d422c92ec5070bee684c37a42c789dd46 (patch)
treecef1fb3a4b4f68d96e8d3f6b8adbcf6e0cff1a22 /tests/run/tlet.nim
parent31a994cc107100c9c6f84455832ccce0b5fd9661 (diff)
downloadNim-7fcbdc6d422c92ec5070bee684c37a42c789dd46.tar.gz
implemented 'let' statement
Diffstat (limited to 'tests/run/tlet.nim')
-rw-r--r--tests/run/tlet.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/run/tlet.nim b/tests/run/tlet.nim
new file mode 100644
index 000000000..ba355c5d8
--- /dev/null
+++ b/tests/run/tlet.nim
@@ -0,0 +1,19 @@
+discard """
+  output: '''Very funny, your name is name.
+nameabc'''
+"""
+
+proc main =
+  let name = "name"
+  if name == "":
+    echo("Poor soul, you lost your name?")
+  elif name == "name":
+    echo("Very funny, your name is name.")
+  else:
+    Echo("Hi, ", name, "!")
+    
+  let (x, y) = ("abc", name)
+  echo y, x
+
+main()
+