Skip to content

assert_eq!() might need a better fail message #6221

Description

@Kimundi

assert_eq!(left, right) used to fail with fmt!("expected: %?, given: %?", right, left), which was confusing because it was neither clear which of the two parameters of assert_eq is supposed to be the 'given' and 'expected' value, and because the values got printed out swapped compared to the way the arguments are given.

It now fails with fmt!("left: %? != right: %?", left, right), which, while less confusing, is still kinda unclear because it doesn't contain any description of what happened.

The message should probably be more verbose, like fmt!("expected equal, but left side %? != right side %?", left, right)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions