Fully match stderr, return if not nightly, shorten file

This commit is contained in:
5225225 2021-06-28 18:29:38 +01:00
parent 9e4c0e1e44
commit 950c415583

View File

@ -1171,7 +1171,10 @@ fn doc_workspace_open_help_message() {
#[cargo_test]
#[cfg(not(windows))] // `echo` may not be available
fn doc_extern_map_local() {
assert!(is_nightly());
if !is_nightly() {
// -Zextern-html-root-url is unstable
return;
}
let p = project()
.file(
@ -1183,21 +1186,20 @@ fn doc_extern_map_local() {
"#,
)
.file("src/lib.rs", "")
.file(".cargo/config.toml", "doc.extern-map.std = 'local'")
.build();
p.change_file(
".cargo/config.toml",
r#"
[doc.extern-map]
std = "local"
"#,
);
p.cargo("doc -v --no-deps -Zrustdoc-map --open")
.env("BROWSER", "echo")
.masquerade_as_nightly_cargo()
.with_stderr_contains("[..] Documenting foo v0.1.0 ([..])")
.with_stderr_does_not_contain("warning: unused config key `doc.extern-map` [..]")
.with_stderr(
"\
[DOCUMENTING] foo v0.1.0 [..]
[RUNNING] `rustdoc --crate-type lib --crate-name foo src/lib.rs [..]--crate-version 0.1.0`
[FINISHED] [..]
Opening [CWD]/target/doc/foo/index.html
",
)
.run();
}