diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-05-11 00:09:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-11 00:09:35 +0900 |
| commit | d34915f691ca78596f57fcb73bbc9de08675d65a (patch) | |
| tree | 427f33b804831917de064889cf9cbe7477b04a4b /src/test/rustdoc-js | |
| parent | 7274447c36949bb63bef0a78bc23f8842d8c7320 (diff) | |
| parent | a9a90d450d11a06dff8bc49a89352e733e904fcf (diff) | |
Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomez
rustdoc: search result ranking fix # Before  # After 
Diffstat (limited to 'src/test/rustdoc-js')
| -rw-r--r-- | src/test/rustdoc-js/path-ordering.js | 14 | ||||
| -rw-r--r-- | src/test/rustdoc-js/path-ordering.rs | 9 |
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; +} |
