summary refs log tree commit diff stats
path: root/tests/js
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-07-12 10:11:59 +0200
committerAraq <rumpf_a@web.de>2019-07-12 10:11:59 +0200
commiteaf4b42ff99b4e7bd77232dc53035e93682aaa73 (patch)
treee3624c91f4e2b778d58f0909dde6dfaa04b498a8 /tests/js
parent511b6ae27c1aae27c3f7bb8aed83245a752d4f4c (diff)
downloadNim-eaf4b42ff99b4e7bd77232dc53035e93682aaa73.tar.gz
JS codegen: supports toOpenArray [bugfix]
Diffstat (limited to 'tests/js')
-rw-r--r--tests/js/tstringitems.nim10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/js/tstringitems.nim b/tests/js/tstringitems.nim
index f09793dde..16df04149 100644
--- a/tests/js/tstringitems.nim
+++ b/tests/js/tstringitems.nim
@@ -1,6 +1,9 @@
 discard """
   output: '''Hello
-Hello'''
+Hello
+c
+d
+e'''
 """
 
 block: # bug #2581
@@ -85,3 +88,8 @@ block: # String cmp
   doAssert(cmp("foo", "foobar") == -3)
   doAssert(cmp("fooz", "foog") == 19)
   doAssert(cmp("foog", "fooz") == -19)
+
+proc main(x: openArray[char]) =
+  for c in x: echo c
+
+main(toOpenArray(['a', 'b', 'c', 'd', 'e'], 2, 4))