Skip to content

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

@dkuku

Description

@dkuku

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions