summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2021-01-05 10:52:26 -0600
committerGitHub <noreply@github.com>2021-01-05 17:52:26 +0100
commitc04f305bf791ee5ecfd17f5a40d009d9c6b6f07a (patch)
tree5c0a24f50e8fd073448ff98634d7d4c01e01f1da /tests
parent0c4bd65e8d2d81a5e52624215e864f7846eb320b (diff)
downloadNim-c04f305bf791ee5ecfd17f5a40d009d9c6b6f07a.tar.gz
make cstrutils work in VM (#16590)
* make cstrutils work in VM

* more
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tcstrutils.nim12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/stdlib/tcstrutils.nim b/tests/stdlib/tcstrutils.nim
index 1daf32aa5..ba3b1de68 100644
--- a/tests/stdlib/tcstrutils.nim
+++ b/tests/stdlib/tcstrutils.nim
@@ -2,21 +2,25 @@ discard """
   targets: "c cpp js"
 """
 
-import cstrutils
+import std/cstrutils
 
 
-block tcstrutils:
+proc main() =
   let s = cstring "abcdef"
   doAssert s.startsWith("a")
   doAssert not s.startsWith("b")
   doAssert s.endsWith("f")
   doAssert not s.endsWith("a")
+  doAssert s.startsWith("")
+  doAssert s.endsWith("")
 
   let a = cstring "abracadabra"
   doAssert a.startsWith("abra")
   doAssert not a.startsWith("bra")
   doAssert a.endsWith("abra")
   doAssert not a.endsWith("dab")
+  doAssert a.startsWith("")
+  doAssert a.endsWith("")
 
   doAssert cmpIgnoreCase(cstring "FooBar", "foobar") == 0
   doAssert cmpIgnoreCase(cstring "bar", "Foo") < 0
@@ -28,3 +32,7 @@ block tcstrutils:
   doAssert cmpIgnoreCase(cstring "", cstring "") == 0
   doAssert cmpIgnoreCase(cstring "", cstring "Hello") < 0
   doAssert cmpIgnoreCase(cstring "wind", cstring "") > 0
+
+
+static: main()
+main()