summary refs log tree commit diff stats
path: root/tests/js/tnilstrs.nim
blob: c0048cb2400957c9442044e10768a74897a63d15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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"