Skip to content

Commit

Permalink
rustdoc: remove the word "Version" from test cases
Browse files Browse the repository at this point in the history
Needed for rust-lang/rust#115948 to merge.
  • Loading branch information
notriddle committed Oct 10, 2023
1 parent 414d9e3 commit c14121e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ fn crate_versions() {
let output_path = p.root().join("target/doc/foo/index.html");
let output_documentation = fs::read_to_string(&output_path).unwrap();

assert!(output_documentation.contains("Version 1.2.4"));
assert!(output_documentation.contains("1.2.4"));
}

#[cargo_test]
Expand All @@ -2028,7 +2028,7 @@ fn crate_versions_flag_is_overridden() {
};
let asserts = |html: String| {
assert!(!html.contains("1.2.4"));
assert!(html.contains("Version 2.0.3"));
assert!(html.contains("2.0.3"));
};

p.cargo("doc")
Expand Down
8 changes: 5 additions & 3 deletions tests/testsuite/rustdocflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,19 @@ fn whitespace() {
.with_status(101)
.run();

const SPACED_VERSION: &str = "a\nb\tc\u{00a0}d";
p.cargo("doc")
.env_remove("__CARGO_TEST_FORCE_ARGFILE") // Not applicable for argfile.
.env(
"RUSTDOCFLAGS",
format!("--crate-version {}", SPACED_VERSION),
format!("--crate-version {}", "1111\n2222\t3333\u{00a0}4444"),
)
.run();

let contents = p.read_file("target/doc/foo/index.html");
assert!(contents.contains(SPACED_VERSION));
assert!(contents.contains("1111"));
assert!(contents.contains("2222"));
assert!(contents.contains("3333"));
assert!(contents.contains("4444"));
}

#[cargo_test]
Expand Down

0 comments on commit c14121e

Please sign in to comment.