diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-12 15:51:44 -0800 |
---|---|---|
committer | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-14 17:00:54 -0800 |
commit | e17321aa2429c6bed97bef28a149fd21166b90a2 (patch) | |
tree | bbc3cff97147320bbbb00b54afb9d169f0794904 /tests/compiler | |
parent | dd1f23f6fc9c3d57f5d3e2a44d2abe4dc1b57a2a (diff) | |
download | Nim-e17321aa2429c6bed97bef28a149fd21166b90a2.tar.gz |
improve formatting in assertEquals
Diffstat (limited to 'tests/compiler')
-rw-r--r-- | tests/compiler/tunittest_light.nim | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/compiler/tunittest_light.nim b/tests/compiler/tunittest_light.nim index d20293d5b..422474002 100644 --- a/tests/compiler/tunittest_light.nim +++ b/tests/compiler/tunittest_light.nim @@ -24,17 +24,16 @@ proc testMismatch() = """ - doAssert mismatch(a, b) == """ + let output = mismatch(a, b) + let expected = """ -lhs:{ - some test with space at the end of lines \n +lhs:{ some test with space at the end of lines \n \n can be hard to spot differences when diffing in a terminal \n without this helper function\n \n } -rhs:{ - some test with space at the end of lines \n +rhs:{ some test with space at the end of lines \n \n can be hard to spot differences when diffing in a terminal \n without this helper function\n @@ -42,14 +41,15 @@ rhs:{ } lhs.len: 144 rhs.len: 143 first mismatch index: 110 -lhs[i]: {" "} rhs[i]: {"\n"}lhs[0..<i]:{ - some test with space at the end of lines \n -\n - can be hard to spot differences when diffing in a terminal } -rhs[0..<i]:{ - some test with space at the end of lines \n +lhs[i]: {" "} +rhs[i]: {"\n"} +lhs[0..<i]:{ some test with space at the end of lines \n \n can be hard to spot differences when diffing in a terminal }""" + if output != expected: + echo output + doAssert false + testMismatch() testAssertEquals() |