Skip to content

Commit 1919ce7

Browse files
committed
Add test to try to catch doc --open issue with extern-map
1 parent 0989dc1 commit 1919ce7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/testsuite/doc.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,40 @@ fn doc_workspace_open_help_message() {
11681168
.run();
11691169
}
11701170

1171+
#[cargo_test]
1172+
#[cfg(not(windows))] // `echo` may not be available
1173+
fn doc_extern_map_local() {
1174+
assert!(is_nightly());
1175+
1176+
let p = project()
1177+
.file(
1178+
"Cargo.toml",
1179+
r#"
1180+
[package]
1181+
name = "foo"
1182+
version = "0.1.0"
1183+
"#,
1184+
)
1185+
.file("src/lib.rs", "")
1186+
.build();
1187+
1188+
p.change_file(
1189+
".cargo/config.toml",
1190+
r#"
1191+
[doc.extern-map]
1192+
std = "local"
1193+
"#,
1194+
);
1195+
1196+
1197+
p.cargo("doc -Zrustdoc-map --open")
1198+
.env("BROWSER", "echo")
1199+
.masquerade_as_nightly_cargo()
1200+
.with_stderr_contains("[..] Documenting foo v0.1.0 ([..])")
1201+
.with_stderr_does_not_contain("warning: unused config key `doc.extern-map` [..]")
1202+
.run();
1203+
}
1204+
11711205
#[cargo_test]
11721206
#[cfg(not(windows))] // `echo` may not be available
11731207
fn doc_workspace_open_different_library_and_package_names() {

0 commit comments

Comments
 (0)