about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2025-09-25 15:23:49 -0700
committerMichael Howell <michael@notriddle.com>2025-09-25 15:45:11 -0700
commit51ae86dec97f4db86f624f609c41f6bf5e620301 (patch)
treeb45d4f93aad7939191bdd834a5e2c244d5af5e26
parent8daad494b11ae5d0e5282be485625687bcf27e37 (diff)
downloadrust-51ae86dec97f4db86f624f609c41f6bf5e620301.tar.gz
rust-51ae86dec97f4db86f624f609c41f6bf5e620301.zip
rustdoc-search: add test case for all/index.html search
-rw-r--r--tests/rustdoc-gui/search-title.goml12
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs1
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/search-title.goml b/tests/rustdoc-gui/search-title.goml
index 83321a05f2b..5808ed845a3 100644
--- a/tests/rustdoc-gui/search-title.goml
+++ b/tests/rustdoc-gui/search-title.goml
@@ -20,3 +20,15 @@ assert-document-property: {"title": '"another one" Search - Rust'}
 press-key: "Escape"
 
 assert-document-property: {"title": |title|}
+
+// check that all.html does it correctly, too.
+go-to: "file://" + |DOC_PATH| + "/test_docs/all.html"
+assert-document-property: {"title": "List of all items in this crate"}
+call-function: ("perform-search", {"query": "verify"})
+assert-document-property: {"title": '"verify" Search - Rust'}
+
+// check that index.html does it correctly, too.
+go-to: "file://" + |DOC_PATH| + "/index.html"
+assert-document-property: {"title": "Index of crates"}
+call-function: ("perform-search", {"query": "verify"})
+assert-document-property: {"title": '"verify" Search - Rust'}
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index 42f2fbd93b1..08523d0df2f 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -1,3 +1,4 @@
+//@ compile-flags: --enable-index-page -Z unstable-options
 //! The point of this crate is to be able to have enough different "kinds" of
 //! documentation generated so we can test each different features.
 #![doc(html_playground_url="https://play.rust-lang.org/")]