Skip to content

Commit bc5d57c

Browse files
committed
Reproduce #14076
The `with_stderr_contains()` (as well as the new `with_stderr_data()` too, see #14060) has no effect when using with `run_expect_error()`.
1 parent 6a43035 commit bc5d57c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

tests/testsuite/check_cfg.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,9 @@ fn config_invalid_empty() {
632632
.build();
633633

634634
p.cargo("check")
635-
.with_stderr_contains("[..]missing field `level`[..]")
635+
.with_stderr_contains(
636+
"[..]missing field `level`[..] THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T",
637+
)
636638
.run_expect_error();
637639
}
638640

tests/testsuite/freshness.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,6 +2936,9 @@ fn use_mtime_cache_in_cargo_home() {
29362936
.with_stderr(
29372937
"\
29382938
[DIRTY] foo v0.5.0 ([CWD]): [..]
2939+
2940+
THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T
2941+
29392942
[CHECKING] foo v0.5.0 ([CWD])
29402943
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]",
29412944
)

tests/testsuite/help.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ fn help_alias() {
147147
// The `empty-alias` returns an error.
148148
cargo_process("help empty-alias")
149149
.env("PATH", Path::new(""))
150-
.with_stderr_contains("[..]The subcommand 'empty-alias' wasn't recognized[..]")
150+
.with_stderr_contains("THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T [..] The subcommand 'empty-alias' wasn't recognized [..]",
151+
)
151152
.run_expect_error();
152153

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

0 commit comments

Comments
 (0)