diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-04-27 21:32:58 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-04-27 21:33:05 +0200 |
commit | 7c538b26ad03b077da84766771b85d72d978b598 (patch) | |
tree | 06630946771d4cf4e49b6a84c06c38721a021beb /tests/system | |
parent | c8a412998a5ca16a7f96c6f6d41061d976aa13b4 (diff) | |
download | Nim-7c538b26ad03b077da84766771b85d72d978b598.tar.gz |
nil in string concats does not produce crashes anymore
Diffstat (limited to 'tests/system')
-rw-r--r-- | tests/system/tnilconcats.nim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/system/tnilconcats.nim b/tests/system/tnilconcats.nim new file mode 100644 index 000000000..ce059b7b0 --- /dev/null +++ b/tests/system/tnilconcats.nim @@ -0,0 +1,25 @@ +discard """ + output: '''@[nil, nil, nil, nil, nil, nil, nil, "meh"]''' + exitcode: "0" +""" + +when true: + var ab: string + ab &= "more" + + doAssert ab == "more" + + var x: seq[string] + + setLen(x, 7) + + x.add "meh" + + var s: string + var z = "abc" + var zz: string + s &= "foo" & z & zz + + doAssert s == "fooabc" + + echo x |