summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-04-10 15:49:04 +0200
committerAraq <rumpf_a@web.de>2019-04-10 15:49:04 +0200
commitbc50795d9c43a54db90030dd03f7b3460ccd2df9 (patch)
tree2f61285ab949c34f6a0b08426ababc2bbee26be3 /tests/destructor
parent26fc7d465a3fe9ba1ad2311810ce4e3c4d2d3a32 (diff)
downloadNim-bc50795d9c43a54db90030dd03f7b3460ccd2df9.tar.gz
enable most tnewruntime_strutils tests
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tnewruntime_strutils.nim66
1 files changed, 28 insertions, 38 deletions
diff --git a/tests/destructor/tnewruntime_strutils.nim b/tests/destructor/tnewruntime_strutils.nim
index 51ace8a42..2ac6b5845 100644
--- a/tests/destructor/tnewruntime_strutils.nim
+++ b/tests/destructor/tnewruntime_strutils.nim
@@ -1,7 +1,6 @@
 discard """
   cmd: '''nim c --newruntime $file'''
-  output: '''136 136'''
-  disabled: "true"
+  output: '''316 316'''
 """
 
 import strutils, os
@@ -135,33 +134,34 @@ proc staticTests =
   doAssert join([1, 2, 3]) == "123"
   doAssert join(@[1, 2, 3], ", ") == "1, 2, 3"
 
-  doAssert """~~!!foo
-~~!!bar
-~~!!baz""".unindent(2, "~~!!") == "foo\nbar\nbaz"
-
-  doAssert """~~!!foo
-~~!!bar
-~~!!baz""".unindent(2, "~~!!aa") == "~~!!foo\n~~!!bar\n~~!!baz"
-  doAssert """~~foo
-~~  bar
-~~  baz""".unindent(4, "~") == "foo\n  bar\n  baz"
-  doAssert """foo
-bar
-  baz
-""".unindent(4) == "foo\nbar\nbaz\n"
-  doAssert """foo
+  when false:
+    doAssert """~~!!foo
+  ~~!!bar
+  ~~!!baz""".unindent(2, "~~!!") == "foo\nbar\nbaz"
+
+    doAssert """~~!!foo
+  ~~!!bar
+  ~~!!baz""".unindent(2, "~~!!aa") == "~~!!foo\n~~!!bar\n~~!!baz"
+    doAssert """~~foo
+  ~~  bar
+  ~~  baz""".unindent(4, "~") == "foo\n  bar\n  baz"
+    doAssert """foo
   bar
-  baz
-""".unindent(2) == "foo\n  bar\n  baz\n"
-  doAssert """foo
-  bar
-  baz
-""".unindent(100) == "foo\nbar\nbaz\n"
-
-  doAssert """foo
-  foo
-  bar
-""".unindent() == "foo\nfoo\nbar\n"
+    baz
+  """.unindent(4) == "foo\nbar\nbaz\n"
+    doAssert """foo
+    bar
+    baz
+  """.unindent(2) == "foo\n  bar\n  baz\n"
+    doAssert """foo
+    bar
+    baz
+  """.unindent(100) == "foo\nbar\nbaz\n"
+
+    doAssert """foo
+    foo
+    bar
+  """.unindent() == "foo\nfoo\nbar\n"
 
   let s = " this is an example  "
   let s2 = ":this;is;an:example;;"
@@ -178,16 +178,6 @@ bar
   doAssert s.splitWhitespace(maxsplit=3) == @["this", "is", "an", "example  "]
   doAssert s.splitWhitespace(maxsplit=4) == @["this", "is", "an", "example"]
 
-  block: # startsWith / endsWith char tests
-    var s = "abcdef"
-    doAssert s.startsWith('a')
-    doAssert s.startsWith('b') == false
-    doAssert s.endsWith('f')
-    doAssert s.endsWith('a') == false
-    doAssert s.endsWith('\0') == false
-
-  #echo("strutils tests passed")
-
 nonStaticTests()
 staticTests()