Skip to content

Commit

Permalink
Auto merge of #14051 - henry40408:issue-14039-shell-quoting, r=weihanglo
Browse files Browse the repository at this point in the history
test: migrate features_are_quoted to snapbox

### What does this PR try to resolve?

Part of #14039.

Migrate `tests/testsuite/shell_quoting.rs` to snapbox.

### How should we test and review this PR?

N/A

### Additional information

N/A
  • Loading branch information
bors committed Jun 13, 2024
2 parents 00ea165 + 3a19de7 commit 5f0294b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/testsuite/shell_quoting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
//! in the output, their arguments are quoted properly
//! so that the command can be run in a terminal.

#![allow(deprecated)]

use cargo_test_support::project;
use cargo_test_support::str;

#[cargo_test]
fn features_are_quoted() {
Expand All @@ -26,14 +25,17 @@ fn features_are_quoted() {
.build();

p.cargo("check -v")
.env("MSYSTEM", "1")
.with_status(101)
.with_stderr_contains(
r#"[RUNNING] `rustc [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]`"#
).with_stderr_contains(
r#"
.env("MSYSTEM", "1")
.with_status(101)
.with_stderr_data(str![[r#"
[CHECKING] foo v0.1.0 ([ROOT]/foo)
[RUNNING] `rustc [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]`
...
[ERROR] could not compile `foo` (bin "foo") due to 1 previous error
Caused by:
process didn't exit successfully: [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]"#
)
.run();
process didn't exit successfully: [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]
"#]])
.run();
}

0 comments on commit 5f0294b

Please sign in to comment.