Skip to content

Commit 3a76b8c

Browse files
committed
Auto merge of rust-lang#14187 - dieterplex:migrate-ssh-snapbox, r=epage
test: Migrate network tests to snapbox Part of rust-lang#14039.
2 parents d1b5f07 + 47253e4 commit 3a76b8c

File tree

2 files changed

+113
-103
lines changed

2 files changed

+113
-103
lines changed

tests/testsuite/https.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
//! Note that these tests will generally require setting CARGO_CONTAINER_TESTS
44
//! or CARGO_PUBLIC_NETWORK_TESTS.
55
6-
#![allow(deprecated)]
7-
86
use cargo_test_support::containers::Container;
97
use cargo_test_support::project;
8+
use cargo_test_support::str;
109

1110
#[cargo_test(container_test)]
1211
fn self_signed_should_fail() {
@@ -43,10 +42,10 @@ fn self_signed_should_fail() {
4342
};
4443
p.cargo("fetch")
4544
.with_status(101)
46-
.with_stderr(&format!(
45+
.with_stderr_data(&format!(
4746
"\
4847
[UPDATING] git repository `https://127.0.0.1:[..]/repos/bar.git`
49-
error: failed to get `bar` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
48+
[ERROR] failed to get `bar` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
5049
5150
Caused by:
5251
failed to load source for dependency `bar`
@@ -55,7 +54,7 @@ Caused by:
5554
Unable to update https://127.0.0.1:[..]/repos/bar.git
5655
5756
Caused by:
58-
failed to clone into: [ROOT]/home/.cargo/git/db/bar-[..]
57+
failed to clone into: [ROOT]/home/.cargo/git/db/bar-[HASH]
5958
6059
Caused by:
6160
network failure seems to have happened
@@ -129,12 +128,11 @@ fn self_signed_with_cacert() {
129128
.file("server.crt", &server_crt)
130129
.build();
131130
p.cargo("fetch")
132-
.with_stderr(
133-
"\
131+
.with_stderr_data(str![[r#"
134132
[UPDATING] git repository `https://127.0.0.1:[..]/repos/bar.git`
135133
[LOCKING] 2 packages to latest compatible versions
136-
",
137-
)
134+
135+
"#]])
138136
.run();
139137
}
140138

@@ -157,11 +155,10 @@ fn github_works() {
157155
.file("src/lib.rs", "")
158156
.build();
159157
p.cargo("fetch")
160-
.with_stderr(
161-
"\
158+
.with_stderr_data(str![[r#"
162159
[UPDATING] git repository `https://github.com/rust-lang/bitflags.git`
163160
[LOCKING] 2 packages to latest compatible versions
164-
",
165-
)
161+
162+
"#]])
166163
.run();
167164
}

0 commit comments

Comments
 (0)