mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00

* Collapse the nested cargotest::support module into the cargotest module (merge the mod.rs's) * Rename the cargotest module to support * Nest the top-level hamcrest module into support
52 lines
1.1 KiB
Rust
52 lines
1.1 KiB
Rust
use cargo;
|
|
use support::{execs, project};
|
|
use support::hamcrest::assert_that;
|
|
|
|
#[test]
|
|
fn simple() {
|
|
let p = project().build();
|
|
|
|
assert_that(
|
|
p.cargo("version"),
|
|
execs()
|
|
.with_status(0)
|
|
.with_stdout(&format!("{}\n", cargo::version())),
|
|
);
|
|
|
|
assert_that(
|
|
p.cargo("--version"),
|
|
execs()
|
|
.with_status(0)
|
|
.with_stdout(&format!("{}\n", cargo::version())),
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
#[cfg_attr(target_os = "windows", ignore)]
|
|
fn version_works_without_rustc() {
|
|
let p = project().build();
|
|
assert_that(p.cargo("version").env("PATH", ""), execs().with_status(0));
|
|
}
|
|
|
|
#[test]
|
|
fn version_works_with_bad_config() {
|
|
let p = project()
|
|
.file(".cargo/config", "this is not toml")
|
|
.build();
|
|
assert_that(p.cargo("version"), execs().with_status(0));
|
|
}
|
|
|
|
#[test]
|
|
fn version_works_with_bad_target_dir() {
|
|
let p = project()
|
|
.file(
|
|
".cargo/config",
|
|
r#"
|
|
[build]
|
|
target-dir = 4
|
|
"#,
|
|
)
|
|
.build();
|
|
assert_that(p.cargo("version"), execs().with_status(0));
|
|
}
|