]> git.proxmox.com Git - cargo.git/blame - tests/testsuite/version.rs
Upgrade to Rust 2018
[cargo.git] / tests / testsuite / version.rs
CommitLineData
c2ff988c 1use cargo;
04ddd4d0 2use crate::support::project;
fc982531 3
6950bbb0
AC
4#[test]
5fn simple() {
7fe2fbc8 6 let p = project().build();
fc982531 7
85984a87
DW
8 p.cargo("version")
9 .with_stdout(&format!("{}\n", cargo::version()))
10 .run();
1e682848 11
85984a87
DW
12 p.cargo("--version")
13 .with_stdout(&format!("{}\n", cargo::version()))
14 .run();
6950bbb0 15}
13171985 16
885e7ea1 17#[test]
fe642329 18#[cfg_attr(target_os = "windows", ignore)]
885e7ea1 19fn version_works_without_rustc() {
7fe2fbc8 20 let p = project().build();
85984a87 21 p.cargo("version").env("PATH", "").run();
67367a65 22}
a3ae2996
AK
23
24#[test]
25fn version_works_with_bad_config() {
85984a87
DW
26 let p = project().file(".cargo/config", "this is not toml").build();
27 p.cargo("version").run();
a3ae2996
AK
28}
29
30#[test]
31fn version_works_with_bad_target_dir() {
7fe2fbc8 32 let p = project()
1e682848
AC
33 .file(
34 ".cargo/config",
35 r#"
a3ae2996
AK
36 [build]
37 target-dir = 4
1e682848 38 "#,
85984a87
DW
39 ).build();
40 p.cargo("version").run();
a3ae2996 41}