summary refs log tree commit diff stats
path: root/testament/lib/stdtest/unittest_light.nim
diff options
context:
space:
mode:
Diffstat (limited to 'testament/lib/stdtest/unittest_light.nim')
-rw-r--r--testament/lib/stdtest/unittest_light.nim6
1 files changed, 2 insertions, 4 deletions
diff --git a/testament/lib/stdtest/unittest_light.nim b/testament/lib/stdtest/unittest_light.nim
index d9842b399..bf254c11f 100644
--- a/testament/lib/stdtest/unittest_light.nim
+++ b/testament/lib/stdtest/unittest_light.nim
@@ -1,5 +1,3 @@
-# note: consider merging tests/assert/testhelper.nim here.
-
 proc mismatch*[T](lhs: T, rhs: T): string =
   ## Simplified version of `unittest.require` that satisfies a common use case,
   ## while avoiding pulling too many dependencies. On failure, diagnostic
@@ -31,8 +29,8 @@ proc mismatch*[T](lhs: T, rhs: T): string =
       result.add "lhs[0..<i]:{" & replaceInvisible($lhs[
           0..<i]) & "}"
 
-proc assertEquals*[T](lhs: T, rhs: T) =
+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)
+    doAssert false, mismatch(lhs, rhs) & "\n" & msg