Skip to content

Assertions error messages should be multiline for better readability #1

@joel-costigliola

Description

@joel-costigliola

Some assertions error message are single line which is not very handy in IDE, one must often copy the message in a text editor and reformat it to read it easily.

Let's take the failing assertion below :

Date date = parse("2002-12-18");
assertThat(date).isBefore("2002-12-10");

It leads to an assertion error with the following message in Eclipse :

java.lang.AssertionError: expected:<2002-12-18T00:00:00> to be strictly before:<2002-12-10T00:00:00>

But it would be more readable if it were multiline like this :

java.lang.AssertionError: 
expected:
  <2002-12-18T00:00:00> 
to be strictly before:
  <2002-12-10T00:00:00>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions