Skip to content

Commit 7d1b785

Browse files
committed
test: migrate net_config to snapbox
1 parent 08158b4 commit 7d1b785

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

tests/testsuite/net_config.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//! Tests for network configuration.
22
3-
#![allow(deprecated)]
4-
53
use cargo_test_support::project;
4+
use cargo_test_support::str;
65

76
#[cargo_test]
87
fn net_retry_loads_from_config() {
@@ -33,10 +32,11 @@ fn net_retry_loads_from_config() {
3332

3433
p.cargo("check -v")
3534
.with_status(101)
36-
.with_stderr_contains(
37-
"[WARNING] spurious network error \
38-
(1 tries remaining): [..]",
39-
)
35+
.with_stderr_data(str![[r#"
36+
...
37+
[WARNING] spurious network error (1 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 11 after [..] ms: Couldn't connect to server)[..]
38+
...
39+
"#]])
4040
.run();
4141
}
4242

@@ -67,10 +67,11 @@ fn net_retry_git_outputs_warning() {
6767

6868
p.cargo("check -v -j 1")
6969
.with_status(101)
70-
.with_stderr_contains(
71-
"[WARNING] spurious network error \
72-
(2 tries remaining): [..]",
73-
)
74-
.with_stderr_contains("[WARNING] spurious network error (1 tries remaining): [..]")
70+
.with_stderr_data(str![[r#"
71+
...
72+
[WARNING] spurious network error (2 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 11 after [..] ms: Couldn't connect to server)[..]
73+
[WARNING] spurious network error (1 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 11 after [..] ms: Couldn't connect to server)[..]
74+
...
75+
"#]])
7576
.run();
7677
}

0 commit comments

Comments
 (0)