-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom panic messages in snapbox #223
Comments
Yeah, I've recently gotten requests for this from others. When creating
The main care about I had was then handled with If we move forward with this, I would expect we'd try to match the new assert format that is coming out soon, where relevant. My main concern is what the API should look like for something like this. |
Do you have a link for or more context about that? |
This leaves us room to evaluate assert-rs#223 Fixes assert-rs#226
This leaves us room to evaluate assert-rs#223 Fixes assert-rs#226
This leaves us room to evaluate assert-rs#223 Fixes assert-rs#226 Cherry pick 2a1a25f (assert-rs#296)
std::assert_eq
supports providing a custom panic message in a third argument (optionally followed by further parameters for the message arguments).pretty_assertions
andsimilar-asserts
both provideassert_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.
The text was updated successfully, but these errors were encountered: