From d19cdb67b61c22eb8f17c70367a541ce8406ca8e Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 10 Oct 2023 10:13:16 -0700 Subject: [PATCH] rustdoc: remove the word "Version" from test cases Needed for https://github.com/rust-lang/rust/pull/115948 to merge. --- tests/testsuite/doc.rs | 4 ++-- tests/testsuite/rustdocflags.rs | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index 481df859045f..a16980912460 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -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] @@ -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") diff --git a/tests/testsuite/rustdocflags.rs b/tests/testsuite/rustdocflags.rs index 6992961ce392..a1f5bd108c73 100644 --- a/tests/testsuite/rustdocflags.rs +++ b/tests/testsuite/rustdocflags.rs @@ -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]