fix some more tests with regexp

This commit is contained in:
Aleksey Kladov 2016-05-15 00:44:18 +03:00
parent 1a2257bfb6
commit 2904e36b4b
13 changed files with 58 additions and 58 deletions

View file

@ -1312,7 +1312,7 @@ test!(lib_with_standard_name {
assert_that(p.cargo_process("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] syntax v0.0.1 ({dir})
",
dir = p.url())));
@ -1408,7 +1408,7 @@ test!(freshness_ignores_excluded {
assert_that(foo.cargo("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
@ -1455,14 +1455,14 @@ test!(rebuild_preserves_out_dir {
assert_that(foo.cargo("build").env("FIRST", "1"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
File::create(&foo.root().join("src/bar.rs")).unwrap();
assert_that(foo.cargo("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
});

View file

@ -28,7 +28,7 @@ test!(custom_build_script_failed {
"#);
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(101)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.5.0 ({url})
[RUNNING] `rustc build.rs --crate-name build_script_build --crate-type bin [..]`
[RUNNING] `[..]build-script-build[..]`

View file

@ -850,7 +850,7 @@ test!(stale_cached_version {
// Now build!
assert_that(foo.cargo("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] bar v0.0.0 ({bar}#[..])
[COMPILING] foo v0.0.0 ({foo})
@ -990,7 +990,7 @@ test!(dev_deps_with_testing {
// Generate a lockfile which did not use `bar` to compile, but had to update
// `bar` to generate the lockfile
assert_that(p.cargo_process("build"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] foo v0.5.0 ({url})
", url = p.url(), bar = p2.url())));
@ -1032,7 +1032,7 @@ test!(git_build_cmd_freshness {
assert_that(foo.cargo("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url})
", url = foo.url())));
@ -1083,7 +1083,7 @@ test!(git_name_not_always_needed {
// Generate a lockfile which did not use `bar` to compile, but had to update
// `bar` to generate the lockfile
assert_that(p.cargo_process("build"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] foo v0.5.0 ({url})
", url = p.url(), bar = p2.url())));
@ -1116,7 +1116,7 @@ test!(git_repo_changing_no_rebuild {
p1.build();
p1.root().move_into_the_past().unwrap();
assert_that(p1.cargo("build"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] [..]
[COMPILING] [..]
@ -1142,7 +1142,7 @@ test!(git_repo_changing_no_rebuild {
"#, bar.url()))
.file("src/main.rs", "fn main() {}");
assert_that(p2.cargo_process("build"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[UPDATING] git repository `{bar}`
[COMPILING] [..]
[COMPILING] [..]
@ -1238,7 +1238,7 @@ test!(fetch_downloads {
"#, bar.url()))
.file("src/main.rs", "fn main() {}");
assert_that(p.cargo_process("fetch"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] git repository `{url}`
", url = bar.url())));
@ -1373,7 +1373,7 @@ test!(update_one_dep_in_repo_with_many_deps {
assert_that(p.cargo("update")
.arg("-p").arg("foo"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[UPDATING] git repository `{}`
", foo.url())));
});
@ -1427,7 +1427,7 @@ test!(switch_deps_does_not_update_transitive {
p.build();
assert_that(p.cargo("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[UPDATING] git repository `{}`
[UPDATING] git repository `{}`
[COMPILING] transitive [..]
@ -1448,7 +1448,7 @@ test!(switch_deps_does_not_update_transitive {
assert_that(p.cargo("build"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[UPDATING] git repository `{}`
[COMPILING] dep [..]
[COMPILING] project [..]

View file

@ -594,7 +594,7 @@ test!(cross_with_a_build_script {
assert_that(p.cargo_process("build").arg("--target").arg(&target).arg("-v"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.0 (file://[..])
[RUNNING] `rustc build.rs [..] --out-dir {dir}[..]target[..]build[..]foo-[..]`
[RUNNING] `{dir}[..]target[..]build[..]foo-[..]build-script-build`
@ -835,7 +835,7 @@ test!(build_script_with_platform_specific_dependencies {
assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] d2 v0.0.0 ([..])
[RUNNING] `rustc d2[..]src[..]lib.rs [..]`
[COMPILING] d1 v0.0.0 ([..])

View file

@ -22,7 +22,7 @@ test!(simple {
"#);
assert_that(p.cargo_process("doc"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[..] foo v0.0.1 ({dir})
[..] foo v0.0.1 ({dir})
",
@ -64,7 +64,7 @@ test!(doc_twice {
"#);
assert_that(p.cargo_process("doc"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[DOCUMENTING] foo v0.0.1 ({dir})
",
dir = path2url(p.root()))));
@ -99,7 +99,7 @@ test!(doc_deps {
"#);
assert_that(p.cargo_process("doc"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[..] bar v0.0.1 ({dir}/bar)
[..] bar v0.0.1 ({dir}/bar)
[DOCUMENTING] foo v0.0.1 ({dir})
@ -145,7 +145,7 @@ test!(doc_no_deps {
"#);
assert_that(p.cargo_process("doc").arg("--no-deps"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] bar v0.0.1 ({dir}/bar)
[DOCUMENTING] foo v0.0.1 ({dir})
",

View file

@ -340,14 +340,14 @@ test!(same_build_dir_cached_packages {
p.build();
assert_that(p.cargo("build").cwd(p.root().join("a1")),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] d v0.0.1 ({dir}/d)
[COMPILING] c v0.0.1 ({dir}/c)
[COMPILING] b v0.0.1 ({dir}/b)
[COMPILING] a1 v0.0.1 ({dir}/a1)
", dir = p.url())));
assert_that(p.cargo("build").cwd(p.root().join("a2")),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] a2 v0.0.1 ({dir}/a2)
", dir = p.url())));
});

View file

@ -60,7 +60,7 @@ test!(simple {
pkg("foo", "0.0.1");
assert_that(cargo_process("install").arg("foo"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 (registry file://[..])
@ -70,7 +70,7 @@ test!(simple {
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(cargo_process("uninstall").arg("foo"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[REMOVING] {home}[..]bin[..]foo[..]
",
home = cargo_home().display())));
@ -82,7 +82,7 @@ test!(pick_max_version {
pkg("foo", "0.0.2");
assert_that(cargo_process("install").arg("foo"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.2 (registry file://[..])
[COMPILING] foo v0.0.2 (registry file://[..])
@ -412,7 +412,7 @@ test!(install_force {
p.build();
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.2.0 ([..])
[REPLACING] {home}[..]bin[..]foo[..]
",
@ -452,7 +452,7 @@ test!(install_force_partial_overlap {
p.build();
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.2.0 ([..])
[INSTALLING] {home}[..]bin[..]foo-bin3[..]
[REPLACING] {home}[..]bin[..]foo-bin2[..]
@ -500,7 +500,7 @@ test!(install_force_bin {
.arg("foo-bin2")
.arg("--path")
.arg(p.root()),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.2.0 ([..])
[REPLACING] {home}[..]bin[..]foo-bin2[..]
",
@ -552,7 +552,7 @@ test!(git_repo {
p.build();
assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] git repository `[..]`
[COMPILING] foo v0.1.0 ([..])
[INSTALLING] {home}[..]bin[..]foo[..]

View file

@ -29,7 +29,7 @@ test!(simple {
.file("src/bar.txt", ""); // should be ignored when packaging
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
@ -71,7 +71,7 @@ test!(metadata_warning {
fn main() {}
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
@ -94,7 +94,7 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
fn main() {}
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
@ -118,7 +118,7 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
fn main() {}
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
@ -182,7 +182,7 @@ test!(package_verification {
assert_that(p.cargo_process("build"),
execs().with_status(0));
assert_that(p.cargo("package"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[PACKAGING] foo v0.0.1 ({dir})
[VERIFYING] foo v0.0.1 ({dir})
[COMPILING] foo v0.0.1 ({dir}[..])
@ -354,7 +354,7 @@ test!(ignore_nested {
.file("a_dir/nested/src/main.rs", main_rs);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[PACKAGING] nested v0.0.1 ({dir})
[VERIFYING] nested v0.0.1 ({dir})
[COMPILING] nested v0.0.1 ({dir}[..])

View file

@ -49,7 +49,7 @@ test!(simple {
.file("src/main.rs", "fn main() {}");
assert_that(p.cargo_process("publish").arg("--no-verify"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[PACKAGING] foo v0.0.1 ({dir})
[UPLOADING] foo v0.0.1 ({dir})

View file

@ -27,7 +27,7 @@ test!(simple {
Package::new("bar", "0.0.1").publish();
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
@ -38,7 +38,7 @@ test!(simple {
// Don't download a second time
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[..] bar v0.0.1 (registry file://[..])
[..] foo v0.0.1 ({dir})
@ -64,7 +64,7 @@ test!(deps {
Package::new("bar", "0.0.1").dep("baz", "*").publish();
assert_that(p.cargo_process("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
@ -189,7 +189,7 @@ version required: >= 0.0.0
Package::new("notyet", "0.0.1").publish();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] notyet v0.0.1 (registry file://[..])
[COMPILING] notyet v0.0.1 (registry file://[..])
@ -266,7 +266,7 @@ test!(lockfile_locks {
Package::new("bar", "0.0.1").publish();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
@ -299,7 +299,7 @@ test!(lockfile_locks_transitively {
Package::new("bar", "0.0.1").dep("baz", "*").publish();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
@ -337,7 +337,7 @@ test!(yanks_are_not_used {
Package::new("bar", "0.0.2").dep("baz", "*").yanked(true).publish();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
@ -468,7 +468,7 @@ test!(update_lockfile {
println!("0.0.2 build");
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[DOWNLOADING] [..] v0.0.2 (registry file://[..])
[COMPILING] bar v0.0.2 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
@ -485,7 +485,7 @@ test!(update_lockfile {
println!("0.0.3 build");
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[DOWNLOADING] [..] v0.0.3 (registry file://[..])
[COMPILING] bar v0.0.3 (registry file://[..])
[COMPILING] foo v0.0.1 ({dir})
@ -532,7 +532,7 @@ test!(dev_dependency_not_used {
Package::new("bar", "0.0.1").dev_dep("baz", "*").publish();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] [..] v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
@ -596,7 +596,7 @@ test!(updating_a_dep {
Package::new("bar", "0.0.1").publish();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] bar v0.0.1 (registry file://[..])
[COMPILING] bar v0.0.1 (registry file://[..])
@ -618,7 +618,7 @@ test!(updating_a_dep {
println!("second");
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] bar v0.1.0 (registry file://[..])
[COMPILING] bar v0.1.0 (registry file://[..])
@ -661,7 +661,7 @@ test!(git_and_registry_dep {
p.root().move_into_the_past().unwrap();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] [..]
[UPDATING] [..]
[DOWNLOADING] a v0.0.1 (registry file://[..])
@ -707,7 +707,7 @@ test!(update_publish_then_update {
fs::remove_dir_all(&p.root().join("target")).unwrap();
assert_that(p.cargo("build"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[UPDATING] [..]
[DOWNLOADING] a v0.1.1 (registry file://[..])
[COMPILING] a v0.1.1 (registry [..])

View file

@ -474,7 +474,7 @@ test!(release_works {
"#);
assert_that(p.cargo_process("run").arg("--release"),
execs().with_status(0).with_stdout(&format!("\
execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[RUNNING] `target{sep}release{sep}foo[..]`
",

View file

@ -1083,7 +1083,7 @@ test!(test_no_run {
assert_that(p.cargo_process("test").arg("--no-run"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
",
dir = p.url())));
@ -1175,7 +1175,7 @@ test!(test_no_harness {
assert_that(p.cargo_process("test").arg("--").arg("--nocapture"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[RUNNING] target[..]bar-[..]
",
@ -1457,7 +1457,7 @@ test!(example_bin_same_name {
assert_that(p.cargo_process("test").arg("--no-run").arg("-v"),
execs().with_status(0)
.with_stdout(&format!("\
.with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[RUNNING] `rustc [..]`
[RUNNING] `rustc [..]`

View file

@ -25,7 +25,7 @@ test!(pathless_tools {
"#, target));
assert_that(foo.cargo_process("build").arg("--verbose"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc [..] -C ar=nonexistent-ar -C linker=nonexistent-linker [..]`
", url = foo.url())))
@ -65,7 +65,7 @@ test!(absolute_tools {
};
assert_that(foo.cargo_process("build").arg("--verbose"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc [..] -C ar={ar} -C linker={linker} [..]`
", url = foo.url(), ar = output.0, linker = output.1)))
@ -112,7 +112,7 @@ test!(relative_tools {
};
assert_that(origin.cargo_process("build").cwd(foo_path).arg("--verbose"),
execs().with_stdout(&format!("\
execs().with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc [..] -C ar={ar} -C linker={linker} [..]`
", url = foo_url, ar = output.0, linker = output.1)))