Skip to content

Commit f0d3cdf

Browse files
committed
rustdoc: remove the word "Version" from test cases
Needed for rust-lang/rust#115948 to merge.
1 parent c97c906 commit f0d3cdf

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tests/testsuite/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ fn crate_versions() {
20042004
let output_path = p.root().join("target/doc/foo/index.html");
20052005
let output_documentation = fs::read_to_string(&output_path).unwrap();
20062006

2007-
assert!(output_documentation.contains("Version 1.2.4"));
2007+
assert!(output_documentation.contains("1.2.4"));
20082008
}
20092009

20102010
#[cargo_test]
@@ -2028,7 +2028,7 @@ fn crate_versions_flag_is_overridden() {
20282028
};
20292029
let asserts = |html: String| {
20302030
assert!(!html.contains("1.2.4"));
2031-
assert!(html.contains("Version 2.0.3"));
2031+
assert!(html.contains("2.0.3"));
20322032
};
20332033

20342034
p.cargo("doc")

tests/testsuite/rustdocflags.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,19 @@ fn whitespace() {
110110
.with_status(101)
111111
.run();
112112

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

122121
let contents = p.read_file("target/doc/foo/index.html");
123-
assert!(contents.contains(SPACED_VERSION));
122+
assert!(contents.contains("1111"));
123+
assert!(contents.contains("2222"));
124+
assert!(contents.contains("3333"));
125+
assert!(contents.contains("4444"));
124126
}
125127

126128
#[cargo_test]

0 commit comments

Comments
 (0)