Skip to content

String expectation messages alter content #299

@pak3nuh

Description

@pak3nuh

On expectation fail, the library issues a message displaying what went wrong.

If the expectation is a String object it will wrap the differences in angle brackets [ ]. This is a cool feature that highlights where the problem is but changes the content of the expectation and the actual value.

The issue is worse if the values already contain angle brackets by themselves, making it harder to spot where the problem is. Bellow is the output of a failing test.

expected:<...id:[[[[Lkotlin.Int?][?]]?]]"> but was:<...id:[[[[Lkotlin.Int?][]?]]?]">
Expected :...id:[[[[Lkotlin.Int?][?]]?]]"
Actual   :...id:[[[[Lkotlin.Int?][]?]]?]"

I've checked the custom fail messages, but it seems a different use case.

It would be nice to allow disabling this highlight feature.

Thanks

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