Skip to content

Commit df5696b

Browse files
committed
Auto merge of #2755 - matklad:remove-useless-formats, r=alexcrichton
Remove useless format calls from tests
2 parents 1f67d45 + 40fc7c4 commit df5696b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

tests/net-config.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use hamcrest::assert_that;
77
#[test]
88
fn net_retry_loads_from_config() {
99
let p = project("foo")
10-
.file("Cargo.toml", &format!(r#"
10+
.file("Cargo.toml", r#"
1111
[project]
1212
name = "foo"
1313
version = "0.0.1"
1414
authors = []
1515
1616
[dependencies.bar]
1717
git = "https://127.0.0.1:11/foo/bar"
18-
"#))
18+
"#)
1919
.file("src/main.rs", "").file(".cargo/config", r#"
2020
[net]
2121
retry=1
@@ -25,22 +25,22 @@ fn net_retry_loads_from_config() {
2525

2626
assert_that(p.cargo_process("build").arg("-v"),
2727
execs().with_status(101)
28-
.with_stderr_contains(&format!("[WARNING] spurious network error \
29-
(1 tries remaining): [2/-1] [..]")));
28+
.with_stderr_contains("[WARNING] spurious network error \
29+
(1 tries remaining): [2/-1] [..]"));
3030
}
3131

3232
#[test]
3333
fn net_retry_git_outputs_warning() {
3434
let p = project("foo")
35-
.file("Cargo.toml", &format!(r#"
35+
.file("Cargo.toml", r#"
3636
[project]
3737
name = "foo"
3838
version = "0.0.1"
3939
authors = []
4040
4141
[dependencies.bar]
4242
git = "https://127.0.0.1:11/foo/bar"
43-
"#))
43+
"#)
4444
.file(".cargo/config", r#"
4545
[http]
4646
timeout=1
@@ -49,8 +49,8 @@ fn net_retry_git_outputs_warning() {
4949

5050
assert_that(p.cargo_process("build").arg("-v").arg("-j").arg("1"),
5151
execs().with_status(101)
52-
.with_stderr_contains(&format!("[WARNING] spurious network error \
53-
(2 tries remaining): [2/-1] [..]"))
54-
.with_stderr_contains(&format!("\
55-
[WARNING] spurious network error (1 tries remaining): [2/-1] [..]")));
52+
.with_stderr_contains("[WARNING] spurious network error \
53+
(2 tries remaining): [2/-1] [..]")
54+
.with_stderr_contains("\
55+
[WARNING] spurious network error (1 tries remaining): [2/-1] [..]"));
5656
}

tests/package.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ http://doc.crates.io/manifest.html#package-metadata for more info.
108108
dir = p.url())));
109109

110110
let p = project("all")
111-
.file("Cargo.toml", &format!(r#"
111+
.file("Cargo.toml", r#"
112112
[project]
113113
name = "foo"
114114
version = "0.0.1"
115115
authors = []
116116
license = "MIT"
117117
description = "foo"
118118
repository = "bar"
119-
"#))
119+
"#)
120120
.file("src/main.rs", r#"
121121
fn main() {}
122122
"#);

tests/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,9 +2115,9 @@ fn only_test_docs() {
21152115

21162116
assert_that(p.cargo("test").arg("--doc"),
21172117
execs().with_status(0)
2118-
.with_stderr(&format!("\
2118+
.with_stderr("\
21192119
[COMPILING] foo v0.0.1 ([..])
2120-
[DOCTEST] foo"))
2120+
[DOCTEST] foo")
21212121
.with_stdout("
21222122
running 1 test
21232123
test bar_0 ... ok

0 commit comments

Comments
 (0)