From e17321aa2429c6bed97bef28a149fd21166b90a2 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sat, 12 Jan 2019 15:51:44 -0800 Subject: [PATCH] improve formatting in assertEquals --- compiler/unittest_light.nim | 15 ++++++++------- tests/compiler/tunittest_light.nim | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/compiler/unittest_light.nim b/compiler/unittest_light.nim index bcba6f7c73..d9842b3994 100644 --- a/compiler/unittest_light.nim +++ b/compiler/unittest_light.nim @@ -14,8 +14,8 @@ proc mismatch*[T](lhs: T, rhs: T): string = proc quoted(s: string): string = result.addQuoted s result.add "\n" - result.add "lhs:{\n" & replaceInvisible( - $lhs) & "}\nrhs:{\n" & replaceInvisible($rhs) & "}\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" @@ -26,12 +26,13 @@ proc mismatch*[T](lhs: T, rhs: T): string = i.inc result.add "first mismatch index: " & $i & "\n" if i < lhs.len and i < rhs.len: - result.add "lhs[i]: {" & quoted($lhs[i]) & "} rhs[i]: {" & quoted( - $rhs[i]) & "}" - result.add "lhs[0..