cargo/tests/testsuite/shell_quoting.rs
Michael Hewson 727684da74 added a test that feature=foo will be quoted
The doesn’t doesn’t seem to run when I run `cargo test` though
2018-07-03 14:19:48 -04:00

44 lines
1.1 KiB
Rust

//! this file tests that when the commands being run are shown
//! in the output, their arguments are quoted properly
//! so that the command can be run in a terminal
use cargotest::support::{
execs,
project,
};
use hamcrest::assert_that
#[test]
fn features_are_quoted() {
let p = project("foo")
.file(
"Cargo.toml",
r#"
[project]
name = "foo"
version = "0.1.0"
authors = ["mikeyhew@example.com"]
[features]
some_feature = []
default = ["some_feature"]
"#,
)
.file("src/main.rs", "fn main() {error}")
.build();
assert_that(
p.cargo("check -v"),
execs()
.with_status(101)
.with_stderr_contains(
r#"\
[CHECKING] foo [..]
[RUNNING] `rustc [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]`
[ERROR] [..]
process didn't exit successfully: `rustc [..] --cfg 'feature="default"' --cfg 'feature="some_feature"' [..]`
"#
)
);
}