summary refs log tree commit diff stats
path: root/tests/js/tstringitems.nim
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2015-04-30 16:09:27 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2015-04-30 16:09:27 +0100
commit0be654efe11311fcf1200c0e7dba9ecd55fa5591 (patch)
tree7f55b6c5f467a7094fb0978841a08a9b1764f0c3 /tests/js/tstringitems.nim
parent4e778f9aac184655135daaff6579ef4a553d225a (diff)
parentd9d5aa60b7df936ffe6149143c7202604f71465f (diff)
downloadNim-0be654efe11311fcf1200c0e7dba9ecd55fa5591.tar.gz
Merge branch 'devel'
Diffstat (limited to 'tests/js/tstringitems.nim')
-rw-r--r--tests/js/tstringitems.nim24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/js/tstringitems.nim b/tests/js/tstringitems.nim
new file mode 100644
index 000000000..f4ea02fec
--- /dev/null
+++ b/tests/js/tstringitems.nim
@@ -0,0 +1,24 @@
+discard """
+  output: '''Hello
+Hello'''
+"""
+
+# bug #2581
+
+const someVars = [ "Hello" ]
+var someVars2 = [ "Hello" ]
+
+proc getSomeVar: string =
+    for i in someVars:
+        if i == "Hello":
+            result = i
+            break
+
+proc getSomeVar2: string =
+    for i in someVars2:
+        if i == "Hello":
+            result = i
+            break
+
+echo getSomeVar()
+echo getSomeVar2()