Add regression tests

This commit is contained in:
hyd-dev 2021-03-13 19:14:57 +08:00
parent bc8093ed55
commit 7ecb5d8601
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
3 changed files with 29 additions and 0 deletions

View 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");
}

View 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");
}

View 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");
}