diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/rustdoc-js/assoc-type.js | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-js/assoc-type.js')
-rw-r--r-- | tests/rustdoc-js/assoc-type.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/rustdoc-js/assoc-type.js b/tests/rustdoc-js/assoc-type.js new file mode 100644 index 000000000..eec4e7a82 --- /dev/null +++ b/tests/rustdoc-js/assoc-type.js @@ -0,0 +1,56 @@ +// exact-check + +const EXPECTED = [ + // if I just use generics, then the generics version + // and the type binding version both show up + { + 'query': 'iterator<something> -> u32', + 'correction': null, + 'others': [ + { 'path': 'assoc_type::my', 'name': 'other_fn' }, + { 'path': 'assoc_type', 'name': 'my_fn' }, + ], + }, + { + 'query': 'iterator<something>', + 'correction': null, + 'in_args': [ + { 'path': 'assoc_type::my', 'name': 'other_fn' }, + { 'path': 'assoc_type', 'name': 'my_fn' }, + ], + }, + { + 'query': 'something', + 'correction': null, + 'others': [ + { 'path': 'assoc_type', 'name': 'Something' }, + ], + 'in_args': [ + { 'path': 'assoc_type::my', 'name': 'other_fn' }, + { 'path': 'assoc_type', 'name': 'my_fn' }, + ], + }, + // if I write an explicit binding, only it shows up + { + 'query': 'iterator<item=something> -> u32', + 'correction': null, + 'others': [ + { 'path': 'assoc_type', 'name': 'my_fn' }, + ], + }, + // case insensitivity + { + 'query': 'iterator<ItEm=sOmEtHiNg> -> u32', + 'correction': null, + 'others': [ + { 'path': 'assoc_type', 'name': 'my_fn' }, + ], + }, + // wrong binding name, no result + { + 'query': 'iterator<something=something> -> u32', + 'correction': null, + 'in_args': [], + 'others': [], + }, +]; |