summary refs log tree commit diff stats
path: root/testament/lib/stdtest/unittest_light.nim
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2021-01-22 03:50:28 -0300
committerGitHub <noreply@github.com>2021-01-22 07:50:28 +0100
commitf1d165adf2f36e483777258a9618a8b540c24017 (patch)
tree7bc36affdc45d4bfd007e6380851a7acd1098ae3 /testament/lib/stdtest/unittest_light.nim
parent3df652b90b9d5ccf7370ffb27eb5ee9f3c8a6cd2 (diff)
downloadNim-f1d165adf2f36e483777258a9618a8b540c24017.tar.gz
Testament small fixes (#16788)
* ReSync with Devel

* ReSync

* Fix Deprecations, Convertion to itself, code style, etc

* Fix Deprecations, Convertion to itself, code style, etc
Diffstat (limited to 'testament/lib/stdtest/unittest_light.nim')
-rw-r--r--testament/lib/stdtest/unittest_light.nim14
1 files changed, 6 insertions, 8 deletions
diff --git a/testament/lib/stdtest/unittest_light.nim b/testament/lib/stdtest/unittest_light.nim
index bf254c11f..273bf72f5 100644
--- a/testament/lib/stdtest/unittest_light.nim
+++ b/testament/lib/stdtest/unittest_light.nim
@@ -11,26 +11,24 @@ proc mismatch*[T](lhs: T, rhs: T): string =
 
   proc quoted(s: string): string = result.addQuoted s
 
-  result.add "\n"
+  result.add '\n'
   result.add "lhs:{" & replaceInvisible(
       $lhs) & "}\nrhs:{" & replaceInvisible($rhs) & "}\n"
   when compiles(lhs.len):
     if lhs.len != rhs.len:
-      result.add "lhs.len: " & $lhs.len & " rhs.len: " & $rhs.len & "\n"
+      result.add "lhs.len: " & $lhs.len & " rhs.len: " & $rhs.len & '\n'
     when compiles(lhs[0]):
       var i = 0
       while i < lhs.len and i < rhs.len:
         if lhs[i] != rhs[i]: break
         i.inc
-      result.add "first mismatch index: " & $i & "\n"
+      result.add "first mismatch index: " & $i & '\n'
       if i < lhs.len and i < rhs.len:
         result.add "lhs[i]: {" & quoted($lhs[i]) & "}\nrhs[i]: {" & quoted(
             $rhs[i]) & "}\n"
       result.add "lhs[0..<i]:{" & replaceInvisible($lhs[
-          0..<i]) & "}"
+          0..<i]) & '}'
 
 proc assertEquals*[T](lhs: T, rhs: T, msg = "") =
-  when false: # can be useful for debugging to see all that's fed to this.
-    echo "----" & $lhs
-  if lhs!=rhs:
-    doAssert false, mismatch(lhs, rhs) & "\n" & msg
+  if lhs != rhs:
+    doAssert false, mismatch(lhs, rhs) & '\n' & msg