prevent null characters in $ on collections of char

This commit is contained in:
Arne Döring 2017-07-24 23:55:30 +02:00
commit 11914a23be
2 changed files with 9 additions and 4 deletions

View file

@ -47,7 +47,5 @@ doAssert dataStr == $data
import strutils
# array test
let arr = ['H','e','l','l','o',' ','W','o','r','l','d','!','\0']
# not sure if this is really a good idea
doAssert startsWith($arr, "[H, e, l, l, o, , W, o, r, l, d, !,")
doAssert $arr == "[H, e, l, l, o, , W, o, r, l, d, !, ]"
doAssert $arr.cstring == "Hello World!"