Skip to content
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

Support an extra failure message directly in assert_that! and expect_that!. #334

Merged
1 commit merged into from
Dec 8, 2023

Conversation

hovinen
Copy link
Collaborator

@hovinen hovinen commented Dec 6, 2023

This adds optional additional parameters to assert_that! and expect_that! which, if present, are formatted via format! into a failure message in the event of an assertion failure. The formatting takes place only if the assertion fails. Otherwise, the extra arguments have no effect.

Fixes #331

@hovinen hovinen force-pushed the add-message-parameter-to-macros branch from 5705c90 to 5346492 Compare December 6, 2023 13:24
…ct_that!`.

This adds optional additional parameters to `assert_that!` and `expect_that!` which, if present, are formatted via `format!` into a failure message in the event of an assertion failure. The formatting takes place only if the assertion fails. Otherwise, the extra arguments have no effect.

Fixes #331
@hovinen hovinen force-pushed the add-message-parameter-to-macros branch from 5346492 to 82df24c Compare December 6, 2023 13:39
@copybara-service copybara-service bot closed this pull request by merging all changes into main in 330ff30 Dec 8, 2023
@gribozavr gribozavr deleted the add-message-parameter-to-macros branch February 17, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for custom formatted error messages in *_that!
1 participant