rust/tests/rustdoc-js-std
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
..
alias-1.js
alias-2.js
alias-3.js
alias-4.js
alias.js
asrawfd.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
basic.js
bufread-fill-buf.js
deduplication.js
enum-option.js
filter-crate.js
fn-forget.js
from_u.js
full-path-function.js
iterator-type-signatures.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
keyword.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
macro-check.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
macro-print.js
never.js
option-type-signatures.js rustdoc-search: fix bugs when unboxing and reordering combine 2023-09-09 16:58:37 -07:00
osstring-to-string.js
parser-bindings.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
parser-errors.js rustdoc-search: replace TAB/NL/LF with SP first 2023-11-29 11:02:56 -07:00
parser-filter.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
parser-generics.js
parser-ident.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
parser-literal.js
parser-paths.js rustdoc-search: allow :: and :: 2023-11-29 11:02:50 -07:00
parser-quote.js
parser-returned.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
parser-separators.js rustdoc-search: replace TAB/NL/LF with SP first 2023-11-29 11:02:56 -07:00
parser-slice-array.js rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
parser-weird-queries.js rustdoc-search: replace TAB/NL/LF with SP first 2023-11-29 11:02:56 -07:00
path-maxeditdistance.js 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
primitive.js
println-typo.js
quoted.js
reference-shrink.js
regex.js
return-specific-literal.js
return-specific.js
should-fail.js
simd-type-signatures.js Update std::simd usage and test outputs 2023-11-26 09:02:25 -05:00
string-from_ut.js
struct-vec.js
typed-query.js
vec-new.js
vec-type-signatures.js rustdoc-search: fix bugs when unboxing and reordering combine 2023-09-09 16:58:37 -07:00