Skip to content

Commit

Permalink
Reproduce #14076
Browse files Browse the repository at this point in the history
The `with_stderr_contains()` (as well as the new `with_stderr_data()` too, see #14060) has no effect when using with `run_expect_error()`.
  • Loading branch information
choznerol committed Jun 15, 2024
1 parent 6a43035 commit bc5d57c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/testsuite/check_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,9 @@ fn config_invalid_empty() {
.build();

p.cargo("check")
.with_stderr_contains("[..]missing field `level`[..]")
.with_stderr_contains(
"[..]missing field `level`[..] THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T",
)
.run_expect_error();
}

Expand Down
3 changes: 3 additions & 0 deletions tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2936,6 +2936,9 @@ fn use_mtime_cache_in_cargo_home() {
.with_stderr(
"\
[DIRTY] foo v0.5.0 ([CWD]): [..]
THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T
[CHECKING] foo v0.5.0 ([CWD])
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]",
)
Expand Down
3 changes: 2 additions & 1 deletion tests/testsuite/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ fn help_alias() {
// The `empty-alias` returns an error.
cargo_process("help empty-alias")
.env("PATH", Path::new(""))
.with_stderr_contains("[..]The subcommand 'empty-alias' wasn't recognized[..]")
.with_stderr_contains("THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T [..] The subcommand 'empty-alias' wasn't recognized [..]",
)
.run_expect_error();

// Because `simple-alias` aliases a subcommand with no arguments, help shows the manpage.
Expand Down

0 comments on commit bc5d57c

Please sign in to comment.