Skip to content

Commit 47a3154

Browse files
committed
test: migrate fetch to snapbox
1 parent d1a62df commit 47a3154

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tests/testsuite/fetch.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
//! Tests for the `cargo fetch` command.
22
3-
#![allow(deprecated)]
4-
53
use cargo_test_support::registry::Package;
64
use cargo_test_support::rustc_host;
7-
use cargo_test_support::{basic_manifest, cross_compile, project};
5+
use cargo_test_support::{basic_manifest, cross_compile, project, str};
86

97
#[cargo_test]
108
fn no_deps() {
@@ -13,7 +11,7 @@ fn no_deps() {
1311
.file("src/a.rs", "")
1412
.build();
1513

16-
p.cargo("fetch").with_stderr("").run();
14+
p.cargo("fetch").with_stderr_data("").run();
1715
}
1816

1917
#[cargo_test]
@@ -59,11 +57,16 @@ fn fetch_all_platform_dependencies_when_no_target_is_given() {
5957
.build();
6058

6159
p.cargo("fetch")
62-
.with_stderr_contains("[DOWNLOADED] d1 v1.2.3 [..]")
63-
.with_stderr_contains("[DOWNLOADED] d2 v0.1.2 [..]")
60+
.with_stderr_data(str![[r#"
61+
...
62+
[DOWNLOADED] d1 v1.2.3 (registry `dummy-registry`)
63+
[DOWNLOADED] d2 v0.1.2 (registry `dummy-registry`)
64+
...
65+
"#]])
6466
.run();
6567
}
6668

69+
#[allow(deprecated)]
6770
#[cargo_test]
6871
fn fetch_platform_specific_dependencies() {
6972
if cross_compile::disabled() {
@@ -135,6 +138,9 @@ fn fetch_warning() {
135138
.file("src/lib.rs", "")
136139
.build();
137140
p.cargo("fetch")
138-
.with_stderr("[WARNING] unused manifest key: package.misspelled")
141+
.with_stderr_data(str![[r#"
142+
[WARNING] unused manifest key: package.misspelled
143+
144+
"#]])
139145
.run();
140146
}

0 commit comments

Comments
 (0)