diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-02-18 09:56:01 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-18 09:56:01 +0100 |
commit | c8e33cbb75caf21a76d379ce94b42baffbefa73f (patch) | |
tree | 2382ee25980be7fa3e89a1a5483cb78857463115 /tests/js | |
parent | 9e754c3b0623433380de171d25bfb862eb2f9ab7 (diff) | |
parent | 8b39551fca81e95b51393a2a8e702eebe3ba7c51 (diff) | |
download | Nim-c8e33cbb75caf21a76d379ce94b42baffbefa73f.tar.gz |
fixed merge conflict
Diffstat (limited to 'tests/js')
-rw-r--r-- | tests/js/tbasicenum.nim | 10 | ||||
-rw-r--r-- | tests/js/tbasics.nim | 37 |
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 |