Skip to content

Commit dd59059

Browse files
committed
test: migrate features_are_quoted to snapbox
1 parent 4dcbca1 commit dd59059

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

tests/testsuite/shell_quoting.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
//! in the output, their arguments are quoted properly
33
//! so that the command can be run in a terminal.
44
5-
#![allow(deprecated)]
6-
75
use cargo_test_support::project;
6+
use cargo_test_support::str;
87

98
#[cargo_test]
109
fn features_are_quoted() {
@@ -26,14 +25,24 @@ fn features_are_quoted() {
2625
.build();
2726

2827
p.cargo("check -v")
29-
.env("MSYSTEM", "1")
30-
.with_status(101)
31-
.with_stderr_contains(
32-
r#"[RUNNING] `rustc [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]`"#
33-
).with_stderr_contains(
34-
r#"
28+
.env("MSYSTEM", "1")
29+
.with_status(101)
30+
.with_stderr_data(str![])
31+
.with_stderr_data(str![[r#"
32+
[CHECKING] foo v0.1.0 ([ROOT]/foo)
33+
[RUNNING] `rustc --crate-name foo --edition=2015 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="some_feature"' -C metadata=c2925e00c1458fcb -C extra-filename=-c2925e00c1458fcb --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps`
34+
error[E0425]: cannot find value `error` in this scope
35+
--> src/main.rs:1:12
36+
|
37+
1 | fn main() {error}
38+
| ^^^^^ not found in this scope
39+
40+
For more information about this error, try `rustc --explain E0425`.
41+
[ERROR] could not compile `foo` (bin "foo") due to 1 previous error
42+
3543
Caused by:
36-
process didn't exit successfully: [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]"#
37-
)
38-
.run();
44+
process didn't exit successfully: `rustc --crate-name foo --edition=2015 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="some_feature"' -C metadata=c2925e00c1458fcb -C extra-filename=-c2925e00c1458fcb --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` (exit status: 1)
45+
46+
"#]])
47+
.run();
3948
}

0 commit comments

Comments
 (0)