Remove useless format calls from tests

This commit is contained in:
Aleksey Kladov 2016-05-31 01:41:36 +03:00
parent 212cca9ff7
commit 40fc7c4e24
3 changed files with 14 additions and 14 deletions

View file

@ -7,7 +7,7 @@ use hamcrest::assert_that;
#[test]
fn net_retry_loads_from_config() {
let p = project("foo")
.file("Cargo.toml", &format!(r#"
.file("Cargo.toml", r#"
[project]
name = "foo"
version = "0.0.1"
@ -15,7 +15,7 @@ fn net_retry_loads_from_config() {
[dependencies.bar]
git = "https://127.0.0.1:11/foo/bar"
"#))
"#)
.file("src/main.rs", "").file(".cargo/config", r#"
[net]
retry=1
@ -25,14 +25,14 @@ fn net_retry_loads_from_config() {
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(101)
.with_stderr_contains(&format!("[WARNING] spurious network error \
(1 tries remaining): [2/-1] [..]")));
.with_stderr_contains("[WARNING] spurious network error \
(1 tries remaining): [2/-1] [..]"));
}
#[test]
fn net_retry_git_outputs_warning() {
let p = project("foo")
.file("Cargo.toml", &format!(r#"
.file("Cargo.toml", r#"
[project]
name = "foo"
version = "0.0.1"
@ -40,7 +40,7 @@ fn net_retry_git_outputs_warning() {
[dependencies.bar]
git = "https://127.0.0.1:11/foo/bar"
"#))
"#)
.file(".cargo/config", r#"
[http]
timeout=1
@ -49,8 +49,8 @@ fn net_retry_git_outputs_warning() {
assert_that(p.cargo_process("build").arg("-v").arg("-j").arg("1"),
execs().with_status(101)
.with_stderr_contains(&format!("[WARNING] spurious network error \
(2 tries remaining): [2/-1] [..]"))
.with_stderr_contains(&format!("\
[WARNING] spurious network error (1 tries remaining): [2/-1] [..]")));
.with_stderr_contains("[WARNING] spurious network error \
(2 tries remaining): [2/-1] [..]")
.with_stderr_contains("\
[WARNING] spurious network error (1 tries remaining): [2/-1] [..]"));
}

View file

@ -108,7 +108,7 @@ http://doc.crates.io/manifest.html#package-metadata for more info.
dir = p.url())));
let p = project("all")
.file("Cargo.toml", &format!(r#"
.file("Cargo.toml", r#"
[project]
name = "foo"
version = "0.0.1"
@ -116,7 +116,7 @@ http://doc.crates.io/manifest.html#package-metadata for more info.
license = "MIT"
description = "foo"
repository = "bar"
"#))
"#)
.file("src/main.rs", r#"
fn main() {}
"#);

View file

@ -2115,9 +2115,9 @@ fn only_test_docs() {
assert_that(p.cargo("test").arg("--doc"),
execs().with_status(0)
.with_stderr(&format!("\
.with_stderr("\
[COMPILING] foo v0.0.1 ([..])
[DOCTEST] foo"))
[DOCTEST] foo")
.with_stdout("
running 1 test
test bar_0 ... ok