elixir-lang/elixir

Inconsistent diff highlighting in ExUnit

Closed this issue · 4 comments

Elixir and Erlang/OTP versions

Elixir 1.18.3 (compiled with Erlang/OTP 27)

Operating system

Linux

Current behavior

This works fine:
Image

But if args are swapped, then the diff is completely different:
Image

Expected behavior

assert [1, 2, 3] == [1, 4, 2, 3]

should have highlighted only the element 4, similarly to

assert [1, 4, 2, 3] == [1, 2, 3]

but using a different color (green).

Yes, it looks like a bug indeed. Especially considering this:

String.myers_difference "123", "1423"
[eq: "1", ins: "4", eq: "23"]

This seems fixed in 1.19.0-rc.0, I think we can close?

Image

I think it's this issue #14268.
We probably forgot to backport #14275 to 1.18? (I confirmed 1.18.4 is affected too)

Perfect. Unlikely to have a new v1.18, so v1.19 it is.