Add regression tests
This commit is contained in:
parent
bc8093ed55
commit
7ecb5d8601
9
src/test/ui/macros/assert-eq-macro-msg.rs
Normal file
9
src/test/ui/macros/assert-eq-macro-msg.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// run-fail
|
||||
// error-pattern:panicked at 'assertion failed: `(left == right)`
|
||||
// error-pattern: left: `2`
|
||||
// error-pattern:right: `3`: 1 + 1 definitely should be 3'
|
||||
// ignore-emscripten no processes
|
||||
|
||||
fn main() {
|
||||
assert_eq!(1 + 1, 3, "1 + 1 definitely should be 3");
|
||||
}
|
11
src/test/ui/macros/assert-matches-macro-msg.rs
Normal file
11
src/test/ui/macros/assert-matches-macro-msg.rs
Normal file
@ -0,0 +1,11 @@
|
||||
// run-fail
|
||||
// error-pattern:panicked at 'assertion failed: `(left matches right)`
|
||||
// error-pattern: left: `2`
|
||||
// error-pattern:right: `3`: 1 + 1 definitely should be 3'
|
||||
// ignore-emscripten no processes
|
||||
|
||||
#![feature(assert_matches)]
|
||||
|
||||
fn main() {
|
||||
assert_matches!(1 + 1, 3, "1 + 1 definitely should be 3");
|
||||
}
|
9
src/test/ui/macros/assert-ne-macro-msg.rs
Normal file
9
src/test/ui/macros/assert-ne-macro-msg.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// run-fail
|
||||
// error-pattern:panicked at 'assertion failed: `(left != right)`
|
||||
// error-pattern: left: `2`
|
||||
// error-pattern:right: `2`: 1 + 1 definitely should not be 2'
|
||||
// ignore-emscripten no processes
|
||||
|
||||
fn main() {
|
||||
assert_ne!(1 + 1, 2, "1 + 1 definitely should not be 2");
|
||||
}
|
Loading…
Reference in New Issue
Block a user