rust/tests/rustdoc-js
Michael Howell 0ea58e2346 rustdoc-search: count path edits with separate edit limit
Since the two are counted separately elsewhere, they should get
their own limits, too. The biggest problem with combining them
is that paths are loosely checked by not requiring every component
to match, which means that if they are short and matched loosely,
they can easily find "drunk typist" matches that make no sense,
like this old result:

    std::collections::btree_map::itermut matching slice::itermut
    maxEditDistance = ("slice::itermut".length) / 3 = 14 / 3 = 4
    editDistance("std", "slice") = 4
    editDistance("itermut", "itermut") = 0
        4 + 0 <= 4 PASS

Of course, `slice::itermut` should not match stuff from btreemap.
`slice` should not match `std`.

The new result counts them separately:

    maxPathEditDistance = "slice".length / 3 = 5 / 3 = 1
    maxEditDistance = "itermut".length / 3 = 7 / 3 = 2
    editDistance("std", "slice") = 4
        4 <= 1 FAIL

Effectively, this makes path queries less "typo-resistant".
It's not zero, but it means `vec` won't match the `v1` prelude.

Queries without parent paths are unchanged.
2023-12-26 18:46:17 -07:00
..
auxiliary Add regression test for #115480 2023-10-11 11:41:39 +02:00
assoc-type-backtrack.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
assoc-type-backtrack.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
assoc-type-loop.js rustdoc-search: avoid infinite where clause unbox 2023-11-24 10:42:11 -07:00
assoc-type-loop.rs rustdoc-search: avoid infinite where clause unbox 2023-11-24 10:42:11 -07:00
assoc-type.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
assoc-type.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
basic.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
basic.rs
big-result.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
big-result.rs rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
doc-alias-filter-out.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
doc-alias-filter-out.rs
doc-alias-filter.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
doc-alias-filter.rs
doc-alias-whitespace.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
doc-alias-whitespace.rs
doc-alias.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
doc-alias.rs
enum-variant-not-type.js rustdoc-search: do not treat associated type names as types 2023-12-10 16:52:21 -07:00
enum-variant-not-type.rs rustdoc-search: do not treat associated type names as types 2023-12-10 16:52:21 -07:00
exact-match.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
exact-match.rs
foreign-type-path.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
foreign-type-path.rs
full-path-function.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
full-path-function.rs Correctly handle paths from foreign items 2023-09-02 23:04:37 +02:00
gat.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
gat.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
generics2.js rustdoc-search: fix accidental shared, mutable map 2023-11-17 18:22:31 -07:00
generics2.rs rustdoc-search: fix accidental shared, mutable map 2023-11-17 18:22:31 -07:00
generics-impl.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
generics-impl.rs
generics-match-ambiguity.js rustdoc-search: fix bugs when unboxing and reordering combine 2023-09-09 16:58:37 -07:00
generics-match-ambiguity.rs rustdoc-search: fix order-independence bug 2023-06-11 18:57:33 -07:00
generics-multi-trait.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
generics-multi-trait.rs
generics-nested.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
generics-nested.rs rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
generics-trait.js rustdoc: fix test case for generics that look like names 2023-09-03 13:06:08 -07:00
generics-trait.rs
generics-unbox.js rustdoc-search: fix bugs when unboxing and reordering combine 2023-09-09 16:58:37 -07:00
generics-unbox.rs rustdoc-search: fix bugs when unboxing and reordering combine 2023-09-09 16:58:37 -07:00
generics.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
generics.rs
impl-trait.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
impl-trait.rs rustdoc-search: fix bug with multi-item impl trait 2023-10-05 22:32:37 -07:00
macro-search.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
macro-search.rs rustdoc: search by macro when query ends with ! 2023-02-16 18:16:09 -07:00
module-substring.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
module-substring.rs
nested-unboxed.js rustdoc-search: build args, return, and generics on one unifier 2023-06-11 18:19:37 -07:00
nested-unboxed.rs rustdoc-search: build args, return, and generics on one unifier 2023-06-11 18:19:37 -07:00
never-search.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
never-search.rs rustdoc-search: search never type with ! 2023-06-12 17:30:23 -07:00
path-maxeditdistance.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
path-maxeditdistance.rs rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
path-ordering.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
path-ordering.rs rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
primitive.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
primitive.rs
prototype.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
prototype.rs
raw-pointer.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
raw-pointer.rs
reexport.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
reexport.rs
search-bag-semantics.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
search-bag-semantics.rs rustdoc: implement bag semantics for function parameter search 2023-03-19 18:19:24 -07:00
search-method-disambiguate.js rustdoc-search: add impl disambiguator to duplicate assoc items 2023-09-21 15:16:44 -07:00
search-method-disambiguate.rs rustdoc-search: add impl disambiguator to duplicate assoc items 2023-09-21 15:16:44 -07:00
search-non-local-trait-impl.js Add regression test for #115480 2023-10-11 11:41:39 +02:00
search-non-local-trait-impl.rs Add regression test for #115480 2023-10-11 11:41:39 +02:00
search-short-types.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
search-short-types.rs
slice-array.js rustdoc: add note about slice/array searches to help popup 2023-06-10 14:08:26 -07:00
slice-array.rs rustdoc: search for slices and arrays by type with [] 2023-06-10 13:52:54 -07:00
struct-like-variant.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
struct-like-variant.rs
substring.js rustdoc-search: remove parallel searchWords array 2023-12-15 16:26:35 -07:00
substring.rs rustdoc-search: remove parallel searchWords array 2023-12-15 16:26:35 -07:00
summaries.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
summaries.rs
trait-methods.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
trait-methods.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
type-parameters.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
type-parameters.rs rustdoc-search: add support for type parameters 2023-09-03 13:06:06 -07:00
where-clause.js Update rustdoc-js* format 2023-06-09 17:00:47 +02:00
where-clause.rs rustdoc: fix type search when more than one where clause applies 2023-03-07 11:37:04 -07:00