about summary refs log tree commit diff
path: root/tests/rustdoc/sidebar
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-07-22 11:12:38 -0700
committerMichael Howell <michael@notriddle.com>2024-08-20 16:51:33 -0700
commit68773c789a6a84a888b69f7287fd294b6dd3625c (patch)
tree3036577a322b906cbd89dd584080e87326b922fd /tests/rustdoc/sidebar
parent5a6054b4a2850d195bf54d7176b4a32382a8df49 (diff)
downloadrust-68773c789a6a84a888b69f7287fd294b6dd3625c.tar.gz
rust-68773c789a6a84a888b69f7287fd294b6dd3625c.zip
rustdoc: add separate section for module items
Diffstat (limited to 'tests/rustdoc/sidebar')
-rw-r--r--tests/rustdoc/sidebar/module.rs16
-rw-r--r--tests/rustdoc/sidebar/top-toc-html.rs1
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/rustdoc/sidebar/module.rs b/tests/rustdoc/sidebar/module.rs
new file mode 100644
index 00000000000..926af71ddfb
--- /dev/null
+++ b/tests/rustdoc/sidebar/module.rs
@@ -0,0 +1,16 @@
+#![crate_name = "foo"]
+
+//@ has 'foo/index.html'
+//@ has - '//section[@id="TOC"]/h3' 'Crate Items'
+
+//@ has 'foo/bar/index.html'
+//@ has - '//section[@id="TOC"]/h3' 'Module Items'
+pub mod bar {
+    //@ has 'foo/bar/struct.Baz.html'
+    //@ !has - '//section[@id="TOC"]/h3' 'Module Items'
+    pub struct Baz;
+}
+
+//@ has 'foo/baz/index.html'
+//@ !has - '//section[@id="TOC"]/h3' 'Module Items'
+pub mod baz {}
diff --git a/tests/rustdoc/sidebar/top-toc-html.rs b/tests/rustdoc/sidebar/top-toc-html.rs
index 6fc84c1964c..fa1325c8dca 100644
--- a/tests/rustdoc/sidebar/top-toc-html.rs
+++ b/tests/rustdoc/sidebar/top-toc-html.rs
@@ -14,6 +14,7 @@
 
 // @has foo/index.html
 // User header
+// @has - '//section[@id="TOC"]/h3' 'Sections'
 // @has - '//section[@id="TOC"]/ul[@class="block top-toc"]/li/a[@href="#basic-link-and-emphasis"]' 'Basic link and emphasis'
 // @count - '//section[@id="TOC"]/ul[@class="block top-toc"]/li/a[@href="#basic-link-and-emphasis"]/em' 0
 // @count - '//section[@id="TOC"]/ul[@class="block top-toc"]/li/a[@href="#basic-link-and-emphasis"]/a' 0