unite icon indicating copy to clipboard operation
unite copied to clipboard

Diff shows too many differences on long wrapped lines

Open eproxus opened this issue 6 years ago • 0 comments

The following test yields a difference in the end of the binary, even though there is none, because of how line breaks are added to pretty terms before the diff is computed:

unite_bug_test() ->
    Bin1 = <<0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
    Bin2 = <<255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>,
    ?assertEqual(Bin1, Bin2).

Output:

 1) unite_bug_test/0 (_build/test/lib/unite/test/bug_test.erl:10)
    Assert equal failed! -Expected- +Actual+
    -<<0-+<<255+,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0,-
      0,0,0,0,0,0,+0,+0>>

eproxus avatar Mar 21 '18 12:03 eproxus