Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
rustdoc: remove the word "Version" from test cases
Needed for rust-lang/rust#115948 to merge.
  • Loading branch information
notriddle authored and epage committed Oct 18, 2023
commit 01a543efdd4d90e0a70064b3fe32e563a5aac6f3
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