Skip to content

Commit e157b6d

Browse files
Jethro Beekmanehuss
authored andcommitted
Fix intermittent test failure due to interleaved stdout
1 parent 04a9a7c commit e157b6d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/testsuite/test.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,7 @@ fn cargo_test_env() {
30493049
#[test]
30503050
fn env_test() {{
30513051
use std::env;
3052-
println!("{{}}", env::var("{}").unwrap());
3052+
eprintln!("{{}}", env::var("{}").unwrap());
30533053
}}
30543054
"#,
30553055
cargo::CARGO_ENV
@@ -3062,13 +3062,17 @@ fn cargo_test_env() {
30623062

30633063
let cargo = cargo_exe().canonicalize().unwrap();
30643064
p.cargo("test --lib -- --nocapture")
3065-
.with_stdout_contains(format!(
3065+
.with_stderr_contains(format!(
30663066
"\
30673067
{}
3068-
test env_test ... ok
30693068
",
30703069
cargo.to_str().unwrap()
30713070
))
3071+
.with_stdout_contains(format!(
3072+
"\
3073+
test env_test ... ok
3074+
",
3075+
))
30723076
.run();
30733077
}
30743078

0 commit comments

Comments
 (0)