Skip to content

Commit

Permalink
Fully match stderr, return if not nightly, shorten file
Browse files Browse the repository at this point in the history
  • Loading branch information
5225225 committed Jun 28, 2021
1 parent 9e4c0e1 commit 950c415
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
}

Expand Down

0 comments on commit 950c415

Please sign in to comment.