mirror of
https://github.com/rust-lang/cargo
synced 2024-09-17 23:01:51 +00:00
727684da74
The doesn’t doesn’t seem to run when I run `cargo test` though
44 lines
1.1 KiB
Rust
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"' [..]`
|
|
"#
|
|
)
|
|
);
|
|
}
|