softwaremill / diffx

Pretty diffs for scala case classes
Apache License 2.0
342 stars 30 forks source link

Properly handle newlines in diff results #432

Closed UnaiUribarri-TomTom closed 1 year ago

UnaiUribarri-TomTom commented 1 year ago

Apply colors to each line of diff result and indent it correctly.

ghostbuster91 commented 1 year ago

Hi, thanks for the PR!

Looks good, one small thing - could you add some test cases to prevent us running into some regression in the future? The output is tested here https://github.com/softwaremill/diffx/blob/master/core/src/test/scala/com/softwaremill/diffx/test/DiffResultTest.scala

UnaiUribarri-TomTom commented 1 year ago

Hi, thanks for the PR!

Looks good, one small thing - could you add some test cases to prevent us running into some regression in the future? The output is tested here https://github.com/softwaremill/diffx/blob/master/core/src/test/scala/com/softwaremill/diffx/test/DiffResultTest.scala

Yes, I will expand the PR with some test.

UnaiUribarri-TomTom commented 1 year ago

I realise that the root issue was that I was comparing lists of Protobuf objects, that have a custom toString method that produced multiline output (I cannot control it, it is a Protobuf decision).

ghostbuster91 commented 1 year ago

released as 0.8.3