Skip to content

Custom panic messages in snapbox #223

Description

@not-my-profile

std::assert_eq supports providing a custom panic message in a third argument (optionally followed by further parameters for the message arguments). pretty_assertions and similar-asserts both provide assert_eq! macros that are compatible.

snapbox however currently appears to hard-code it's panic message:

https://github.com/assert-rs/trycmd/blob/d73c84cda48aebda8a4b3fd404745c8bff0ab649/crates/snapbox/src/assert.rs#L55-L61

I think custom panic messages are a nice way to provide more context to a test failure, so I think it would be great if snapbox supported them.

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

    A-snapboxArea: snapbox package

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions