Skip to content

Commit 7b227de

Browse files
committed
Auto merge of #14214 - eth3lbert:snapbox-fetch-n-la, r=weihanglo
test: migrate fetch and list_availables to snapbox ### What does this PR try to resolve? Part of #14039. Migrate following to snapbox: - `tests/testsuite/fetch.rs` - `tests/testsuite/list_availables.rs`
2 parents 54ee7e3 + 16a2dbd commit 7b227de

File tree

2 files changed

+883
-122
lines changed

2 files changed

+883
-122
lines changed

tests/testsuite/fetch.rs

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

108
#[cargo_test]
119
fn no_deps() {
@@ -14,7 +12,7 @@ fn no_deps() {
1412
.file("src/a.rs", "")
1513
.build();
1614

17-
p.cargo("fetch").with_stderr("").run();
15+
p.cargo("fetch").with_stderr_data("").run();
1816
}
1917

2018
#[cargo_test]
@@ -60,11 +58,16 @@ fn fetch_all_platform_dependencies_when_no_target_is_given() {
6058
.build();
6159

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

70+
#[allow(deprecated)]
6871
#[cargo_test]
6972
fn fetch_platform_specific_dependencies() {
7073
if cross_compile::disabled() {
@@ -136,6 +139,9 @@ fn fetch_warning() {
136139
.file("src/lib.rs", "")
137140
.build();
138141
p.cargo("fetch")
139-
.with_stderr("[WARNING] unused manifest key: package.misspelled")
142+
.with_stderr_data(str![[r#"
143+
[WARNING] unused manifest key: package.misspelled
144+
145+
"#]])
140146
.run();
141147
}

0 commit comments

Comments
 (0)