summary refs log tree commit diff stats
path: root/tests/js/tnilstrs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/tnilstrs.nim')
-rw-r--r--tests/js/tnilstrs.nim17
1 files changed, 17 insertions, 0 deletions
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