mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
1fe079bd62
Otherwise `error-pattern` on the test run stderr can incorrectly match if e.g. the paths in panic backtrace has a matching substring (like if we look for `bar` in the error pattern but username is `baron`).
24 lines
404 B
Rust
24 lines
404 B
Rust
// Meta test for compiletest: check that when we give the wrong error
|
|
// patterns, the test fails.
|
|
|
|
//@ run-fail
|
|
//@ revisions: foo bar
|
|
//@ should-fail
|
|
//@ needs-run-enabled
|
|
//@ compile-flags: --remap-path-prefix={{src-base}}=remapped
|
|
//@[foo] error-pattern:bar
|
|
//@[bar] error-pattern:foo
|
|
|
|
#[cfg(foo)]
|
|
fn die() {
|
|
panic!("foo");
|
|
}
|
|
#[cfg(bar)]
|
|
fn die() {
|
|
panic!("bar");
|
|
}
|
|
|
|
fn main() {
|
|
die();
|
|
}
|