Skip to content

Enhance error messages in inequality assertions#193

Merged
cocuh merged 1 commit intogoogle:masterfrom
MaciejWas:facts-for-basic-ineq
Jun 12, 2025
Merged

Enhance error messages in inequality assertions#193
cocuh merged 1 commit intogoogle:masterfrom
MaciejWas:facts-for-basic-ineq

Conversation

@MaciejWas
Copy link
Contributor

Hi :)

While using assertor I noticed that there are no error messages when asserting inequalities. There were TODOs comments for them so I went ahead and added them.

If some assertion fails during cargo test then instead of:

thread 'some_module::test::some_test' panicked at src/some_file.rs:673:9:
assertion failed: src/some_file.rs:673:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    some_module::test::some_test

the following will be shown:

thread 'some_module::test::some_test' panicked at src/some_file.rs:673:9:
assertion failed: src/some_file.rs:673:9
expected     : 3
to be at most: 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    some_module::test::some_test

@cocuh cocuh merged commit 4643772 into google:master Jun 12, 2025
1 check passed
@cocuh
Copy link
Collaborator

cocuh commented Jun 12, 2025

LGTM. Thank you for your contribution!

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.

2 participants