diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/js/taddnilstr.nim | 4 | ||||
-rw-r--r-- | tests/js/tnilstrs.nim | 17 | ||||
-rw-r--r-- | tests/js/tstrconcat.nim | 5 |
3 files changed, 17 insertions, 9 deletions
diff --git a/tests/js/taddnilstr.nim b/tests/js/taddnilstr.nim deleted file mode 100644 index f5b934fdd..000000000 --- a/tests/js/taddnilstr.nim +++ /dev/null @@ -1,4 +0,0 @@ -var x = "foo".cstring -var y: string -add(y, x) -doAssert y == "foo" diff --git a/tests/js/tnilstrs.nim b/tests/js/tnilstrs.nim new file mode 100644 index 000000000..c0048cb24 --- /dev/null +++ b/tests/js/tnilstrs.nim @@ -0,0 +1,17 @@ +block: + var x: string + var y = "foo" + + echo x + doAssert x == "" + doAssert "" == x + + add(x, y) + y[0] = 'm' + doAssert y == "moo" and x == "foo" + +block: + var x = "foo".cstring + var y: string + add(y, x) + doAssert y == "foo" \ No newline at end of file diff --git a/tests/js/tstrconcat.nim b/tests/js/tstrconcat.nim deleted file mode 100644 index 37c8db687..000000000 --- a/tests/js/tstrconcat.nim +++ /dev/null @@ -1,5 +0,0 @@ -var x: string -var y = "foo" -add(x, y) -y[0] = 'm' -doAssert y == "moo" and x == "foo" |