about summary refs log tree commit diff
path: root/src/test/rustdoc-js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-10 15:58:17 +0000
committerbors <bors@rust-lang.org>2022-05-10 15:58:17 +0000
commitd4c364347ce65cf083d4419195b8232440928d4d (patch)
tree5930ec89b5ac33c607c0475a79d7ac17bf278d92 /src/test/rustdoc-js
parenteead58e75bb3a1d9f00b5a988704328fed6bb2c9 (diff)
parentc5f2c4476e1c72315e7bf405a2e15b5c9489c001 (diff)
Auto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #96717 (Handle mismatched generic param kinds in trait impls betterly)
 - #96725 (Expose process windows_process_extensions_main_thread_handle on Windows)
 - #96849 (Move some tests to more reasonable places)
 - #96861 (Use Rust 2021 prelude in std itself.)
 - #96879 (rustdoc: search result ranking fix)
 - #96882 (Don't subst an AdtDef with its own substs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-js')
-rw-r--r--src/test/rustdoc-js/path-ordering.js14
-rw-r--r--src/test/rustdoc-js/path-ordering.rs9
2 files changed, 23 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/path-ordering.js b/src/test/rustdoc-js/path-ordering.js
new file mode 100644
index 00000000000..4aee569b0f4
--- /dev/null
+++ b/src/test/rustdoc-js/path-ordering.js
@@ -0,0 +1,14 @@
+// exact-check
+
+const QUERY = 'b::ccccccc';
+
+const EXPECTED = {
+    'others': [
+        // `ccccccc` is an exact match for all three of these.
+        // However `b` is a closer match for `bb` than for any
+        // of the others, so it ought to go first.
+        { 'path': 'path_ordering::bb', 'name': 'Ccccccc' },
+        { 'path': 'path_ordering::aa', 'name': 'Ccccccc' },
+        { 'path': 'path_ordering::dd', 'name': 'Ccccccc' },
+    ],
+};
diff --git a/src/test/rustdoc-js/path-ordering.rs b/src/test/rustdoc-js/path-ordering.rs
new file mode 100644
index 00000000000..7843cf7f9dc
--- /dev/null
+++ b/src/test/rustdoc-js/path-ordering.rs
@@ -0,0 +1,9 @@
+pub mod dd {
+    pub struct Ccccccc;
+}
+pub mod aa {
+    pub struct Ccccccc;
+}
+pub mod bb {
+    pub struct Ccccccc;
+}