Skip to content

Commit 2c517d9

Browse files
committed
test: migrate testsuite version to snapbox
1 parent 1e0dca3 commit 2c517d9

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

tests/testsuite/version.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
//! Tests for displaying the cargo version.
22
3-
#![allow(deprecated)]
4-
53
use cargo_test_support::{cargo_process, project};
64

75
#[cargo_test]
86
fn simple() {
97
let p = project().build();
108

119
p.cargo("version")
12-
.with_stdout(&format!("cargo {}\n", cargo::version()))
10+
.with_stdout_data(&format!("cargo {}\n", cargo::version()))
1311
.run();
1412

1513
p.cargo("--version")
16-
.with_stdout(&format!("cargo {}\n", cargo::version()))
14+
.with_stdout_data(&format!("cargo {}\n", cargo::version()))
1715
.run();
1816

1917
p.cargo("-V")
20-
.with_stdout(&format!("cargo {}\n", cargo::version()))
18+
.with_stdout_data(&format!("cargo {}\n", cargo::version()))
2119
.run();
2220
}
2321

@@ -53,10 +51,19 @@ fn version_works_with_bad_target_dir() {
5351
fn verbose() {
5452
// This is mainly to check that it doesn't explode.
5553
cargo_process("-vV")
56-
.with_stdout_contains(&format!("cargo {}", cargo::version()))
57-
.with_stdout_contains("host: [..]")
58-
.with_stdout_contains("libgit2: [..]")
59-
.with_stdout_contains("libcurl: [..]")
60-
.with_stdout_contains("os: [..]")
54+
.with_stdout_data(format!(
55+
"\
56+
cargo {}
57+
release: [..]
58+
commit-hash: [..]
59+
commit-date: [..]
60+
host: [HOST_TARGET]
61+
libgit2: [..] (sys:[..] [..])
62+
libcurl: [..] (sys:[..] [..])
63+
...
64+
os: [..]
65+
",
66+
cargo::version()
67+
))
6168
.run();
6269
}

0 commit comments

Comments
 (0)