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

rustdoc: remove the word "Version" from test cases #12800

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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),
"--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