summary refs log tree commit diff stats
path: root/tests/system
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-07-17 18:22:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-07-17 18:22:20 +0200
commit2e3f477957614fbbd182495cedf718590284d98a (patch)
tree86dc33db7df36d2372aacb5b05b898e3cadfdf4f /tests/system
parentae09879b3a1a87b3949a9847ce517b2a507b7167 (diff)
downloadNim-2e3f477957614fbbd182495cedf718590284d98a.tar.gz
VM: accessing the string terminator is not allowed anymore; cleanup tests/system/tostring.nim
Diffstat (limited to 'tests/system')
-rw-r--r--tests/system/tostring.nim (renamed from tests/system/toString.nim)17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/system/toString.nim b/tests/system/tostring.nim
index ea10f998c..9a6b83f95 100644
--- a/tests/system/toString.nim
+++ b/tests/system/tostring.nim
@@ -1,12 +1,12 @@
 discard """
-  output:""
+  output: ""
 """
 
 doAssert "@[23, 45]" == $(@[23, 45])
 doAssert "[32, 45]" == $([32, 45])
 doAssert """@["", "foo", "bar"]""" == $(@["", "foo", "bar"])
-doAssert """["", "foo", "bar"]""" ==  $(["", "foo", "bar"])
-doAssert """["", "foo", "bar"]""" ==  $(@["", "foo", "bar"].toOpenArray(0, 2))
+doAssert """["", "foo", "bar"]""" == $(["", "foo", "bar"])
+doAssert """["", "foo", "bar"]""" == $(@["", "foo", "bar"].toOpenArray(0, 2))
 
 # bug #2395
 let alphaSet: set[char] = {'a'..'c'}
@@ -69,13 +69,13 @@ var yy: string
 doAssert xx == @[]
 doAssert yy == ""
 
-proc bar(arg: cstring): void =
+proc bar(arg: cstring) =
   doAssert arg[0] == '\0'
 
-proc baz(arg: openarray[char]): void =
+proc baz(arg: openarray[char]) =
   doAssert arg.len == 0
 
-proc stringCompare(): void =
+proc stringCompare() =
   var a,b,c,d,e,f,g: string
   a.add 'a'
   doAssert a == "a"
@@ -102,9 +102,12 @@ proc stringCompare(): void =
   doAssert "" != "\0\0\0\0\0\0\0\0\0\0"
 
   var nilstring: string
-  bar(nilstring)
+  #bar(nilstring)
   baz(nilstring)
 
 stringCompare()
+var nilstring: string
+bar(nilstring)
+
 static:
   stringCompare()
\ No newline at end of file