summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-02-14 15:55:26 +0100
committerAraq <rumpf_a@web.de>2019-02-14 15:55:38 +0100
commitb081eb4d6dbc541babce649af561e93e03420706 (patch)
treea8c1638793fd1641b7f9088a0dfe2276df62359f /tests
parent70f0aab18835bbac748d8b95f5a93f7544380e3f (diff)
downloadNim-b081eb4d6dbc541babce649af561e93e03420706.tar.gz
fixes #10651
Diffstat (limited to 'tests')
-rw-r--r--tests/js/tbasicenum.nim10
-rw-r--r--tests/js/tbasics.nim37
2 files changed, 37 insertions, 10 deletions
diff --git a/tests/js/tbasicenum.nim b/tests/js/tbasicenum.nim
deleted file mode 100644
index a9e9ce2da..000000000
--- a/tests/js/tbasicenum.nim
+++ /dev/null
@@ -1,10 +0,0 @@
-discard """
-  output: "ABCDC"
-"""
-
-type
-  MyEnum = enum
-    A,B,C,D
-# trick the optimizer with an seq:
-var x = @[A,B,C,D]
-echo x[0],x[1],x[2],x[3],MyEnum(2)
\ No newline at end of file
diff --git a/tests/js/tbasics.nim b/tests/js/tbasics.nim
new file mode 100644
index 000000000..0c8d33e7f
--- /dev/null
+++ b/tests/js/tbasics.nim
@@ -0,0 +1,37 @@
+discard """
+  output: '''ABCDC
+1
+14
+ok'''
+"""
+
+type
+  MyEnum = enum
+    A,B,C,D
+# trick the optimizer with an seq:
+var x = @[A,B,C,D]
+echo x[0],x[1],x[2],x[3],MyEnum(2)
+
+# bug #10651
+
+var xa: seq[int]
+var ya = @[1,2]
+xa &= ya
+echo xa[0]
+
+proc test =
+  var yup: seq[int]
+  try:
+    yup.add 14
+    echo yup.pop
+  finally:
+    discard
+
+test()
+
+when true:
+  var a: seq[int]
+
+  a.setLen(0)
+
+  echo "ok"
\ No newline at end of file