about summary refs log tree commit diff
path: root/tests/rustdoc-js
diff options
context:
space:
mode:
authorOli Scherer <github35764891676564198441@oli-obk.de>2025-09-13 07:09:16 +0000
committerGitHub <noreply@github.com>2025-09-13 07:09:16 +0000
commit8ade141c46ea74b7988e48d26f83b2d24d60a991 (patch)
tree2f810c44d18e82c7d160925dc49c157acbae9116 /tests/rustdoc-js
parentfc7eb3c28d2be162dd32951811ce7852bb1a2f6a (diff)
parent520e45a538a6c047c77785f09fdead3842b7b7ba (diff)
downloadrust-8ade141c46ea74b7988e48d26f83b2d24d60a991.tar.gz
rust-8ade141c46ea74b7988e48d26f83b2d24d60a991.zip
Merge pull request #4584 from rust-lang/rustup-2025-09-13
Automatic Rustup
Diffstat (limited to 'tests/rustdoc-js')
-rw-r--r--tests/rustdoc-js/literal-path.js23
-rw-r--r--tests/rustdoc-js/literal-path.rs7
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/rustdoc-js/literal-path.js b/tests/rustdoc-js/literal-path.js
new file mode 100644
index 00000000000..ea999ea1a6f
--- /dev/null
+++ b/tests/rustdoc-js/literal-path.js
@@ -0,0 +1,23 @@
+// exact-check
+
+// This test ensures that literal search is always applied on elements of the path.
+
+const EXPECTED = [
+    {
+        'query': '"some::path"',
+        'others': [
+            { 'path': 'literal_path::some', 'name': 'Path' },
+        ],
+    },
+    {
+        'query': '"somea::path"',
+        'others': [
+            { 'path': 'literal_path::somea', 'name': 'Path' },
+        ],
+    },
+    {
+        'query': '"soma::path"',
+        'others': [
+        ],
+    },
+];
diff --git a/tests/rustdoc-js/literal-path.rs b/tests/rustdoc-js/literal-path.rs
new file mode 100644
index 00000000000..fa7685fd966
--- /dev/null
+++ b/tests/rustdoc-js/literal-path.rs
@@ -0,0 +1,7 @@
+pub mod some {
+    pub struct Path;
+}
+
+pub mod somea {
+    pub struct Path;
+}