summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-js-std/parser-filter.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/rustdoc-js-std/parser-filter.js
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-js-std/parser-filter.js')
-rw-r--r--tests/rustdoc-js-std/parser-filter.js96
1 files changed, 88 insertions, 8 deletions
diff --git a/tests/rustdoc-js-std/parser-filter.js b/tests/rustdoc-js-std/parser-filter.js
index 01f65b478..e23447ab7 100644
--- a/tests/rustdoc-js-std/parser-filter.js
+++ b/tests/rustdoc-js-std/parser-filter.js
@@ -1,4 +1,14 @@
-const QUERY = ['fn:foo', 'enum : foo', 'macro<f>:foo', 'macro!', 'macro:mac!', 'a::mac!'];
+const QUERY = [
+ 'fn:foo',
+ 'enum : foo',
+ 'macro<f>:foo',
+ 'macro!',
+ 'macro:mac!',
+ 'a::mac!',
+ '-> fn:foo',
+ '-> fn:foo<fn:bar>',
+ '-> fn:foo<fn:bar, enum : baz::fuzz>',
+];
const PARSED = [
{
@@ -8,11 +18,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "foo",
generics: [],
+ typeFilter: 5,
}],
foundElems: 1,
original: "fn:foo",
returned: [],
- typeFilter: 5,
userQuery: "fn:foo",
error: null,
},
@@ -23,11 +33,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "foo",
generics: [],
+ typeFilter: 4,
}],
foundElems: 1,
original: "enum : foo",
returned: [],
- typeFilter: 4,
userQuery: "enum : foo",
error: null,
},
@@ -36,9 +46,8 @@ const PARSED = [
foundElems: 0,
original: "macro<f>:foo",
returned: [],
- typeFilter: -1,
userQuery: "macro<f>:foo",
- error: "Unexpected `:`",
+ error: "Unexpected `<` in type filter",
},
{
elems: [{
@@ -47,11 +56,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "macro",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "macro!",
returned: [],
- typeFilter: 14,
userQuery: "macro!",
error: null,
},
@@ -62,11 +71,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "mac",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "macro:mac!",
returned: [],
- typeFilter: 14,
userQuery: "macro:mac!",
error: null,
},
@@ -77,12 +86,83 @@ const PARSED = [
pathWithoutLast: ["a"],
pathLast: "mac",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "a::mac!",
returned: [],
- typeFilter: 14,
userQuery: "a::mac!",
error: null,
},
+ {
+ elems: [],
+ foundElems: 1,
+ original: "-> fn:foo",
+ returned: [{
+ name: "foo",
+ fullPath: ["foo"],
+ pathWithoutLast: [],
+ pathLast: "foo",
+ generics: [],
+ typeFilter: 5,
+ }],
+ userQuery: "-> fn:foo",
+ error: null,
+ },
+ {
+ elems: [],
+ foundElems: 1,
+ original: "-> fn:foo<fn:bar>",
+ returned: [{
+ name: "foo",
+ fullPath: ["foo"],
+ pathWithoutLast: [],
+ pathLast: "foo",
+ generics: [
+ {
+ name: "bar",
+ fullPath: ["bar"],
+ pathWithoutLast: [],
+ pathLast: "bar",
+ generics: [],
+ typeFilter: 5,
+ }
+ ],
+ typeFilter: 5,
+ }],
+ userQuery: "-> fn:foo<fn:bar>",
+ error: null,
+ },
+ {
+ elems: [],
+ foundElems: 1,
+ original: "-> fn:foo<fn:bar, enum : baz::fuzz>",
+ returned: [{
+ name: "foo",
+ fullPath: ["foo"],
+ pathWithoutLast: [],
+ pathLast: "foo",
+ generics: [
+ {
+ name: "bar",
+ fullPath: ["bar"],
+ pathWithoutLast: [],
+ pathLast: "bar",
+ generics: [],
+ typeFilter: 5,
+ },
+ {
+ name: "baz::fuzz",
+ fullPath: ["baz", "fuzz"],
+ pathWithoutLast: ["baz"],
+ pathLast: "fuzz",
+ generics: [],
+ typeFilter: 4,
+ },
+ ],
+ typeFilter: 5,
+ }],
+ userQuery: "-> fn:foo<fn:bar, enum : baz::fuzz>",
+ error: null,
+ },
];