atilaneves / unit-threaded

Advanced unit test framework for D
BSD 3-Clause "New" or "Revised" License
122 stars 38 forks source link

Better support for multi-line Expected / Got #306

Open John-Colvin opened 1 year ago

John-Colvin commented 1 year ago

It can get pretty confusing to read the output when the expected & got values are multi-line. I'm not sure entirely what would be best to solve this, but maybe like this:

Expected:
          | a cup of
          | tea
Got:
          | a cup of brown liquid
          | almost but not entirely
          | unlike tea

or some other way of signalling "this bit is the values"

atilaneves commented 1 year ago

The tricky bit here is figuring out what the algorithm should be, and I don't know myself.

John-Colvin commented 1 year ago

I was imagining "if found newline in message, split lines, prefix each line with |, join the pieces, add a \n to the front, there's your new message". I don't know if the outcome is the right one though.