Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExUnit only formats the common parts between left and right side of assertion #13624

Open
dkuku opened this issue May 31, 2024 · 2 comments
Open

Comments

@dkuku
Copy link
Contributor

dkuku commented May 31, 2024

Elixir and Erlang/OTP versions

Elixir 1.17.0-rc.0 (a2600ea) (compiled with Erlang/OTP 27)

Operating system

Linux

Current behavior

With such minimal test:

     @date DateTime.utc_now() |> Map.from_struct()                                                                                              
                                                                                                                                                                                                         
     test "greets the world" do                                                                                                                                                                         
       assert [@date] == [@date, @date]                                                                                                                                                                 
     end      

The result has only formatted the common parts of both sides of the comparison.
The difference is unformatted, but this is the one that I'm as an user am most interested in. It looks worse when the data structure has more keys than on the screenshot.
image

Expected behavior

The differences between both sides are formatted.

@dkuku
Copy link
Contributor Author

dkuku commented May 31, 2024

Better example - when something does not match partially it is formatted:
image

@josevalim josevalim changed the title [ExUnit] only formats the common parts between left and right side of assertion ExUnit only formats the common parts between left and right side of assertion May 31, 2024
@dkuku
Copy link
Contributor Author

dkuku commented Jun 4, 2024

I created a pr #13631 there are few possible ways how to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants