mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
950e3d9989
Modify panic message for `assert_eq!`, `assert_ne!`, the currently unstable `assert_matches!`, as well as the corresponding `debug_assert_*` macros. ```rust assert_eq!(1 + 1, 3); assert_eq!(1 + 1, 3, "my custom message value={}!", 42); ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3` ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3`: my custom message value=42! ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed left: 2 right: 3 ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed: my custom message value=42! left: 2 right: 3 ``` This PR is a simpler subset of the #111030, but it does NOT stringify the original left and right source code assert expressions, thus should be faster to compile. |
||
---|---|---|
.. | ||
auxiliary | ||
custom-test-frameworks | ||
decl-macro-test.rs | ||
inaccessible-test-modules.rs | ||
inaccessible-test-modules.stderr | ||
issue-12997-1.rs | ||
issue-12997-1.stderr | ||
issue-12997-2.rs | ||
issue-12997-2.stderr | ||
issue-16597-empty.rs | ||
issue-16597.rs | ||
issue-20823.rs | ||
issue-34932.rs | ||
issue-36768.rs | ||
issue-52557.rs | ||
issue-53675-a-test-called-panic.rs | ||
issue-109816.rs | ||
issue-109816.stderr | ||
run-unexported-tests.rs | ||
test-attr-non-associated-functions.rs | ||
test-attr-non-associated-functions.stderr | ||
test-cant-be-shadowed.rs | ||
test-filter-multiple.rs | ||
test-filter-multiple.run.stdout | ||
test-fn-signature-verification-for-explicit-return-type.rs | ||
test-function-signature.rs | ||
test-function-signature.stderr | ||
test-main-not-dead-attr.rs | ||
test-main-not-dead.rs | ||
test-on-not-fn.rs | ||
test-on-not-fn.stderr | ||
test-panic-abort-disabled.rs | ||
test-panic-abort-disabled.stderr | ||
test-panic-abort-nocapture.rs | ||
test-panic-abort-nocapture.run.stderr | ||
test-panic-abort-nocapture.run.stdout | ||
test-panic-abort.rs | ||
test-panic-abort.run.stdout | ||
test-panic-while-printing.rs | ||
test-passed-wasm.rs | ||
test-passed-wasm.run.stdout | ||
test-passed.rs | ||
test-passed.run.stdout | ||
test-runner-hides-buried-main.rs | ||
test-runner-hides-main.rs | ||
test-runner-hides-start.rs | ||
test-should-fail-good-message.rs | ||
test-should-panic-attr.rs | ||
test-should-panic-attr.stderr | ||
test-thread-capture.rs | ||
test-thread-capture.run.stdout | ||
test-thread-nocapture.rs | ||
test-thread-nocapture.run.stderr | ||
test-thread-nocapture.run.stdout | ||
test-type.rs | ||
test-type.run.stdout | ||
test-vs-cfg-test.rs | ||
test-warns-dead-code.rs | ||
test-warns-dead-code.stderr | ||
tests-listing-format-default.rs | ||
tests-listing-format-default.run.stdout | ||
tests-listing-format-json-without-unstableopts.rs | ||
tests-listing-format-json-without-unstableopts.run.stderr | ||
tests-listing-format-json.rs | ||
tests-listing-format-json.run.stdout | ||
tests-listing-format-terse.rs | ||
tests-listing-format-terse.run.stdout |