Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rustdoc-map): dedup --extern-html-too-url for same unit #13544

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: -Zrustdoc-map appends duplicate flags
This `same_deps_multi_occurrence_in_dep_tree` verfies
that duplicate flags were added to rustdoc invocation,
which is a bug
  • Loading branch information
weihanglo committed Mar 6, 2024
commit 3c933e8bbff28ae6dd6392d4f20e4b6a15bcbd1f
43 changes: 43 additions & 0 deletions tests/testsuite/rustdoc_extern_html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,46 @@ fn alt_sparse_registry() {
let gold = p.read_file("target/doc/foo/fn.gold.html");
assert!(gold.contains(r#"href="https://docs.rs/grimm/1.0.0/grimm/struct.Gold.html""#));
}

#[cargo_test(nightly, reason = "--extern-html-root-url is unstable")]
fn same_deps_multi_occurrence_in_dep_tree() {
// rust-lang/cargo#13543
Package::new("baz", "1.0.0")
.file("src/lib.rs", "")
.publish();
Package::new("bar", "1.0.0")
.file("src/lib.rs", "")
.dep("baz", "1.0")
.publish();

let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
edition = "2018"

[dependencies]
bar = "1.0"
baz = "1.0"
"#,
)
.file("src/lib.rs", "")
.file(
".cargo/config.toml",
r#"
[doc.extern-map.registries]
crates-io = "https://docs.rs/"
"#,
)
.build();
p.cargo("doc -v --no-deps -Zrustdoc-map")
.masquerade_as_nightly_cargo(&["rustdoc-map"])
.with_stderr_contains(
"[..]--extern-html-root-url[..]bar=https://docs.rs\
[..]--extern-html-root-url[..]baz=https://docs.rs\
[..]--extern-html-root-url[..]baz=https://docs.rs[..]",
)
.run();
}