Skip to content

Commit

Permalink
Add regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hyd-dev committed Mar 13, 2021
1 parent bc8093e commit 7ecb5d8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/macros/assert-eq-macro-msg.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions src/test/ui/macros/assert-matches-macro-msg.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions src/test/ui/macros/assert-ne-macro-msg.rs
Original file line number Diff line number Diff line change
@@ -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");
}

0 comments on commit 7ecb5d8

Please sign in to comment.