diff options
| author | Michael Howell <michael@notriddle.com> | 2023-04-15 11:53:50 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-04-17 12:16:54 -0700 |
| commit | 4c11822aebd9e9c3bbe798f14fa10ec6db3f3937 (patch) | |
| tree | ce89e933ebd8fb99605784ddf0c97e8f3a22e20d /tests/rustdoc-js/generics-trait.js | |
| parent | 1a7132d4f8dfb2ed6f9267b3bac5391a992d0775 (diff) | |
| download | rust-4c11822aebd9e9c3bbe798f14fa10ec6db3f3937.tar.gz rust-4c11822aebd9e9c3bbe798f14fa10ec6db3f3937.zip | |
rustdoc: restructure type search engine to pick-and-use IDs
This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
Diffstat (limited to 'tests/rustdoc-js/generics-trait.js')
| -rw-r--r-- | tests/rustdoc-js/generics-trait.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/rustdoc-js/generics-trait.js b/tests/rustdoc-js/generics-trait.js index 7876622435b..0e84751603e 100644 --- a/tests/rustdoc-js/generics-trait.js +++ b/tests/rustdoc-js/generics-trait.js @@ -1,9 +1,21 @@ +// exact-check + const QUERY = [ 'Result<SomeTrait>', + 'Result<SomeTraiz>', + 'OtherThingxxxxxxxx', + 'OtherThingxxxxxxxy', +]; + +const CORRECTIONS = [ + null, + null, + null, 'OtherThingxxxxxxxx', ]; const EXPECTED = [ + // Result<SomeTrait> { 'in_args': [ { 'path': 'generics_trait', 'name': 'beta' }, @@ -12,6 +24,21 @@ const EXPECTED = [ { 'path': 'generics_trait', 'name': 'bet' }, ], }, + // Result<SomeTraiz> + { + 'in_args': [], + 'returned': [], + }, + // OtherThingxxxxxxxx + { + 'in_args': [ + { 'path': 'generics_trait', 'name': 'alpha' }, + ], + 'returned': [ + { 'path': 'generics_trait', 'name': 'alef' }, + ], + }, + // OtherThingxxxxxxxy { 'in_args': [ { 'path': 'generics_trait', 'name': 'alpha' }, |
