summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-js-std
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/rustdoc-js-std
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.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')
-rw-r--r--tests/rustdoc-js-std/option-type-signatures.js18
-rw-r--r--tests/rustdoc-js-std/parser-errors.js58
-rw-r--r--tests/rustdoc-js-std/parser-filter.js96
-rw-r--r--tests/rustdoc-js-std/parser-generics.js130
-rw-r--r--tests/rustdoc-js-std/parser-ident.js10
-rw-r--r--tests/rustdoc-js-std/parser-literal.js2
-rw-r--r--tests/rustdoc-js-std/parser-paths.js10
-rw-r--r--tests/rustdoc-js-std/parser-quote.js9
-rw-r--r--tests/rustdoc-js-std/parser-returned.js11
-rw-r--r--tests/rustdoc-js-std/parser-separators.js18
-rw-r--r--tests/rustdoc-js-std/parser-weird-queries.js17
-rw-r--r--tests/rustdoc-js-std/println-typo.js12
12 files changed, 294 insertions, 97 deletions
diff --git a/tests/rustdoc-js-std/option-type-signatures.js b/tests/rustdoc-js-std/option-type-signatures.js
new file mode 100644
index 000000000..6bf421a21
--- /dev/null
+++ b/tests/rustdoc-js-std/option-type-signatures.js
@@ -0,0 +1,18 @@
+const QUERY = [
+ 'option, fnonce -> option',
+ 'option -> default',
+];
+
+const EXPECTED = [
+ {
+ 'others': [
+ { 'path': 'std::option::Option', 'name': 'map' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'std::option::Option', 'name': 'unwrap_or_default' },
+ { 'path': 'std::option::Option', 'name': 'get_or_insert_default' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js
index 98c6f27ca..d1aa840ab 100644
--- a/tests/rustdoc-js-std/parser-errors.js
+++ b/tests/rustdoc-js-std/parser-errors.js
@@ -17,6 +17,7 @@ const QUERY = [
"a b:",
"a (b:",
"_:",
+ "_:a",
"a-bb",
"a>bb",
"ab'",
@@ -48,7 +49,6 @@ const PARSED = [
foundElems: 0,
original: "<P>",
returned: [],
- typeFilter: -1,
userQuery: "<p>",
error: "Found generics without a path",
},
@@ -57,7 +57,6 @@ const PARSED = [
foundElems: 0,
original: "-> <P>",
returned: [],
- typeFilter: -1,
userQuery: "-> <p>",
error: "Found generics without a path",
},
@@ -66,7 +65,6 @@ const PARSED = [
foundElems: 0,
original: "a<\"P\">",
returned: [],
- typeFilter: -1,
userQuery: "a<\"p\">",
error: "Unexpected `\"` in generics",
},
@@ -75,7 +73,6 @@ const PARSED = [
foundElems: 0,
original: "\"P\" \"P\"",
returned: [],
- typeFilter: -1,
userQuery: "\"p\" \"p\"",
error: "Cannot have more than one literal search element",
},
@@ -84,7 +81,6 @@ const PARSED = [
foundElems: 0,
original: "P \"P\"",
returned: [],
- typeFilter: -1,
userQuery: "p \"p\"",
error: "Cannot use literal search when there is more than one element",
},
@@ -93,7 +89,6 @@ const PARSED = [
foundElems: 0,
original: "\"p\" p",
returned: [],
- typeFilter: -1,
userQuery: "\"p\" p",
error: "You cannot have more than one element if you use quotes",
},
@@ -102,7 +97,6 @@ const PARSED = [
foundElems: 0,
original: "\"const\": p",
returned: [],
- typeFilter: -1,
userQuery: "\"const\": p",
error: "You cannot use quotes on type filter",
},
@@ -111,16 +105,14 @@ const PARSED = [
foundElems: 0,
original: "a<:a>",
returned: [],
- typeFilter: -1,
userQuery: "a<:a>",
- error: "Unexpected `:` after `<`",
+ error: "Expected type filter before `:`",
},
{
elems: [],
foundElems: 0,
original: "a<::a>",
returned: [],
- typeFilter: -1,
userQuery: "a<::a>",
error: "Unexpected `::`: paths cannot start with `::`",
},
@@ -129,7 +121,6 @@ const PARSED = [
foundElems: 0,
original: "((a))",
returned: [],
- typeFilter: -1,
userQuery: "((a))",
error: "Unexpected `(`",
},
@@ -138,7 +129,6 @@ const PARSED = [
foundElems: 0,
original: "(p -> p",
returned: [],
- typeFilter: -1,
userQuery: "(p -> p",
error: "Unexpected `(`",
},
@@ -147,7 +137,6 @@ const PARSED = [
foundElems: 0,
original: "::a::b",
returned: [],
- typeFilter: -1,
userQuery: "::a::b",
error: "Paths cannot start with `::`",
},
@@ -156,7 +145,6 @@ const PARSED = [
foundElems: 0,
original: "a::::b",
returned: [],
- typeFilter: -1,
userQuery: "a::::b",
error: "Unexpected `::::`",
},
@@ -165,7 +153,6 @@ const PARSED = [
foundElems: 0,
original: "a::b::",
returned: [],
- typeFilter: -1,
userQuery: "a::b::",
error: "Paths cannot end with `::`",
},
@@ -174,7 +161,6 @@ const PARSED = [
foundElems: 0,
original: ":a",
returned: [],
- typeFilter: -1,
userQuery: ":a",
error: "Expected type filter before `:`",
},
@@ -183,16 +169,14 @@ const PARSED = [
foundElems: 0,
original: "a b:",
returned: [],
- typeFilter: -1,
userQuery: "a b:",
- error: "Unexpected `:`",
+ error: "Unexpected `:` (expected path after type filter)",
},
{
elems: [],
foundElems: 0,
original: "a (b:",
returned: [],
- typeFilter: -1,
userQuery: "a (b:",
error: "Unexpected `(`",
},
@@ -201,8 +185,15 @@ const PARSED = [
foundElems: 0,
original: "_:",
returned: [],
- typeFilter: -1,
userQuery: "_:",
+ error: "Unexpected `:` (expected path after type filter)",
+ },
+ {
+ elems: [],
+ foundElems: 0,
+ original: "_:a",
+ returned: [],
+ userQuery: "_:a",
error: "Unknown type filter `_`",
},
{
@@ -210,7 +201,6 @@ const PARSED = [
foundElems: 0,
original: "a-bb",
returned: [],
- typeFilter: -1,
userQuery: "a-bb",
error: "Unexpected `-` (did you mean `->`?)",
},
@@ -219,7 +209,6 @@ const PARSED = [
foundElems: 0,
original: "a>bb",
returned: [],
- typeFilter: -1,
userQuery: "a>bb",
error: "Unexpected `>` (did you mean `->`?)",
},
@@ -228,7 +217,6 @@ const PARSED = [
foundElems: 0,
original: "ab'",
returned: [],
- typeFilter: -1,
userQuery: "ab'",
error: "Unexpected `'`",
},
@@ -237,7 +225,6 @@ const PARSED = [
foundElems: 0,
original: "a->",
returned: [],
- typeFilter: -1,
userQuery: "a->",
error: "Expected at least one item after `->`",
},
@@ -246,7 +233,6 @@ const PARSED = [
foundElems: 0,
original: '"p" <a>',
returned: [],
- typeFilter: -1,
userQuery: '"p" <a>',
error: "Found generics without a path",
},
@@ -255,7 +241,6 @@ const PARSED = [
foundElems: 0,
original: '"p" a<a>',
returned: [],
- typeFilter: -1,
userQuery: '"p" a<a>',
error: "You cannot have more than one element if you use quotes",
},
@@ -264,7 +249,6 @@ const PARSED = [
foundElems: 0,
original: 'a,<',
returned: [],
- typeFilter: -1,
userQuery: 'a,<',
error: 'Found generics without a path',
},
@@ -273,7 +257,6 @@ const PARSED = [
foundElems: 0,
original: 'aaaaa<>b',
returned: [],
- typeFilter: -1,
userQuery: 'aaaaa<>b',
error: 'Expected `,`, ` `, `:` or `->`, found `b`',
},
@@ -282,16 +265,14 @@ const PARSED = [
foundElems: 0,
original: 'fn:aaaaa<>b',
returned: [],
- typeFilter: -1,
userQuery: 'fn:aaaaa<>b',
- error: 'Expected `,`, ` ` or `->`, found `b`',
+ error: 'Expected `,`, ` `, `:` or `->`, found `b`',
},
{
elems: [],
foundElems: 0,
original: '->a<>b',
returned: [],
- typeFilter: -1,
userQuery: '->a<>b',
error: 'Expected `,` or ` `, found `b`',
},
@@ -300,7 +281,6 @@ const PARSED = [
foundElems: 0,
original: 'a<->',
returned: [],
- typeFilter: -1,
userQuery: 'a<->',
error: 'Unexpected `-` after `<`',
},
@@ -309,7 +289,6 @@ const PARSED = [
foundElems: 0,
original: 'a:: a',
returned: [],
- typeFilter: -1,
userQuery: 'a:: a',
error: 'Paths cannot end with `::`',
},
@@ -318,7 +297,6 @@ const PARSED = [
foundElems: 0,
original: 'a ::a',
returned: [],
- typeFilter: -1,
userQuery: 'a ::a',
error: 'Paths cannot start with `::`',
},
@@ -327,16 +305,14 @@ const PARSED = [
foundElems: 0,
original: "a<a>:",
returned: [],
- typeFilter: -1,
userQuery: "a<a>:",
- error: 'Unexpected `:`',
+ error: 'Unexpected `<` in type filter',
},
{
elems: [],
foundElems: 0,
original: "a<>:",
returned: [],
- typeFilter: -1,
userQuery: "a<>:",
error: 'Unexpected `<` in type filter',
},
@@ -345,7 +321,6 @@ const PARSED = [
foundElems: 0,
original: "a,:",
returned: [],
- typeFilter: -1,
userQuery: "a,:",
error: 'Unexpected `,` in type filter',
},
@@ -354,7 +329,6 @@ const PARSED = [
foundElems: 0,
original: "a<> :",
returned: [],
- typeFilter: -1,
userQuery: "a<> :",
error: 'Unexpected `<` in type filter',
},
@@ -363,7 +337,6 @@ const PARSED = [
foundElems: 0,
original: "mod : :",
returned: [],
- typeFilter: -1,
userQuery: "mod : :",
error: 'Unexpected `:`',
},
@@ -372,7 +345,6 @@ const PARSED = [
foundElems: 0,
original: "a!a",
returned: [],
- typeFilter: -1,
userQuery: "a!a",
error: 'Unexpected `!`: it can only be at the end of an ident',
},
@@ -381,7 +353,6 @@ const PARSED = [
foundElems: 0,
original: "a!!",
returned: [],
- typeFilter: -1,
userQuery: "a!!",
error: 'Cannot have more than one `!` in an ident',
},
@@ -390,7 +361,6 @@ const PARSED = [
foundElems: 0,
original: "mod:a!",
returned: [],
- typeFilter: -1,
userQuery: "mod:a!",
error: 'Invalid search type: macro `!` and `mod` both specified',
},
@@ -399,7 +369,6 @@ const PARSED = [
foundElems: 0,
original: "a!::a",
returned: [],
- typeFilter: -1,
userQuery: "a!::a",
error: 'Cannot have associated items in macros',
},
@@ -408,7 +377,6 @@ const PARSED = [
foundElems: 0,
original: "a<",
returned: [],
- typeFilter: -1,
userQuery: "a<",
error: "Unclosed `<`",
},
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,
+ },
];
diff --git a/tests/rustdoc-js-std/parser-generics.js b/tests/rustdoc-js-std/parser-generics.js
index 0cf7f5019..5a2266dbe 100644
--- a/tests/rustdoc-js-std/parser-generics.js
+++ b/tests/rustdoc-js-std/parser-generics.js
@@ -1,4 +1,11 @@
-const QUERY = ['A<B<C<D>, E>', 'p<> u8', '"p"<a>'];
+const QUERY = [
+ 'A<B<C<D>, E>',
+ 'p<> u8',
+ '"p"<a>',
+ 'p<u<x>>',
+ 'p<u<x>, r>',
+ 'p<u<x, r>>',
+];
const PARSED = [
{
@@ -6,9 +13,8 @@ const PARSED = [
foundElems: 0,
original: 'A<B<C<D>, E>',
returned: [],
- typeFilter: -1,
userQuery: 'a<b<c<d>, e>',
- error: 'Unexpected `<` after `<`',
+ error: 'Unclosed `<`',
},
{
elems: [
@@ -18,6 +24,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
},
{
name: "u8",
@@ -25,12 +32,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "u8",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "p<> u8",
returned: [],
- typeFilter: -1,
userQuery: "p<> u8",
error: null,
},
@@ -50,13 +57,126 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: '"p"<a>',
returned: [],
- typeFilter: -1,
userQuery: '"p"<a>',
error: null,
},
+ {
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "u",
+ fullPath: ["u"],
+ pathWithoutLast: [],
+ pathLast: "u",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ },
+ ],
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: 'p<u<x>>',
+ returned: [],
+ userQuery: 'p<u<x>>',
+ error: null,
+ },
+ {
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "u",
+ fullPath: ["u"],
+ pathWithoutLast: [],
+ pathLast: "u",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ },
+ ],
+ },
+ {
+ name: "r",
+ fullPath: ["r"],
+ pathWithoutLast: [],
+ pathLast: "r",
+ generics: [],
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: 'p<u<x>, r>',
+ returned: [],
+ userQuery: 'p<u<x>, r>',
+ error: null,
+ },
+ {
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "u",
+ fullPath: ["u"],
+ pathWithoutLast: [],
+ pathLast: "u",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ },
+ {
+ name: "r",
+ fullPath: ["r"],
+ pathWithoutLast: [],
+ pathLast: "r",
+ generics: [],
+ },
+ ],
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: 'p<u<x, r>>',
+ returned: [],
+ userQuery: 'p<u<x, r>>',
+ error: null,
+ },
];
diff --git a/tests/rustdoc-js-std/parser-ident.js b/tests/rustdoc-js-std/parser-ident.js
index 6c17d00f1..be42b7aa4 100644
--- a/tests/rustdoc-js-std/parser-ident.js
+++ b/tests/rustdoc-js-std/parser-ident.js
@@ -23,11 +23,11 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
}],
foundElems: 1,
original: "R<!>",
returned: [],
- typeFilter: -1,
userQuery: "r<!>",
error: null,
},
@@ -38,11 +38,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "!",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "!",
returned: [],
- typeFilter: -1,
userQuery: "!",
error: null,
},
@@ -53,11 +53,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "a!",
returned: [],
- typeFilter: 14,
userQuery: "a!",
error: null,
},
@@ -66,7 +66,6 @@ const PARSED = [
foundElems: 0,
original: "a!::b",
returned: [],
- typeFilter: -1,
userQuery: "a!::b",
error: "Cannot have associated items in macros",
},
@@ -77,11 +76,11 @@ const PARSED = [
pathWithoutLast: ["!"],
pathLast: "b",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "!::b",
returned: [],
- typeFilter: -1,
userQuery: "!::b",
error: null,
},
@@ -90,7 +89,6 @@ const PARSED = [
foundElems: 0,
original: "a!::b!",
returned: [],
- typeFilter: -1,
userQuery: "a!::b!",
error: "Cannot have associated items in macros",
},
diff --git a/tests/rustdoc-js-std/parser-literal.js b/tests/rustdoc-js-std/parser-literal.js
index 87b3baff1..3a31d1bdd 100644
--- a/tests/rustdoc-js-std/parser-literal.js
+++ b/tests/rustdoc-js-std/parser-literal.js
@@ -16,11 +16,11 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
}],
foundElems: 1,
original: "R<P>",
returned: [],
- typeFilter: -1,
userQuery: "r<p>",
error: null,
}
diff --git a/tests/rustdoc-js-std/parser-paths.js b/tests/rustdoc-js-std/parser-paths.js
index 9f823f933..f3e421f5f 100644
--- a/tests/rustdoc-js-std/parser-paths.js
+++ b/tests/rustdoc-js-std/parser-paths.js
@@ -8,11 +8,11 @@ const PARSED = [
pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "A::B",
returned: [],
- typeFilter: -1,
userQuery: "a::b",
error: null,
},
@@ -24,6 +24,7 @@ const PARSED = [
pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
+ typeFilter: -1,
},
{
name: "c",
@@ -31,12 +32,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "c",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: 'A::B,C',
returned: [],
- typeFilter: -1,
userQuery: 'a::b,c',
error: null,
},
@@ -56,6 +57,7 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
{
name: "c",
@@ -63,12 +65,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "c",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: 'A::B<f>,C',
returned: [],
- typeFilter: -1,
userQuery: 'a::b<f>,c',
error: null,
},
@@ -79,11 +81,11 @@ const PARSED = [
pathWithoutLast: ["mod"],
pathLast: "a",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "mod::a",
returned: [],
- typeFilter: -1,
userQuery: "mod::a",
error: null,
},
diff --git a/tests/rustdoc-js-std/parser-quote.js b/tests/rustdoc-js-std/parser-quote.js
index 1e16c90de..d5d67cac8 100644
--- a/tests/rustdoc-js-std/parser-quote.js
+++ b/tests/rustdoc-js-std/parser-quote.js
@@ -19,8 +19,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: '-> "p"',
error: null,
},
@@ -31,11 +31,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: '"p",',
returned: [],
- typeFilter: -1,
userQuery: '"p",',
error: null,
},
@@ -44,7 +44,6 @@ const PARSED = [
foundElems: 0,
original: '"p" -> a',
returned: [],
- typeFilter: -1,
userQuery: '"p" -> a',
error: "You cannot have more than one element if you use quotes",
},
@@ -53,7 +52,6 @@ const PARSED = [
foundElems: 0,
original: '"a" -> "p"',
returned: [],
- typeFilter: -1,
userQuery: '"a" -> "p"',
error: "Cannot have more than one literal search element",
},
@@ -62,7 +60,6 @@ const PARSED = [
foundElems: 0,
original: '->"-"',
returned: [],
- typeFilter: -1,
userQuery: '->"-"',
error: 'Unexpected `-` in a string element',
},
@@ -71,7 +68,6 @@ const PARSED = [
foundElems: 0,
original: '"a',
returned: [],
- typeFilter: -1,
userQuery: '"a',
error: 'Unclosed `"`',
},
@@ -80,7 +76,6 @@ const PARSED = [
foundElems: 0,
original: '""',
returned: [],
- typeFilter: -1,
userQuery: '""',
error: 'Cannot have empty string element',
},
diff --git a/tests/rustdoc-js-std/parser-returned.js b/tests/rustdoc-js-std/parser-returned.js
index 6fce17dca..c29813190 100644
--- a/tests/rustdoc-js-std/parser-returned.js
+++ b/tests/rustdoc-js-std/parser-returned.js
@@ -25,8 +25,8 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "-> f<p>",
error: null,
},
@@ -40,8 +40,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "-> p",
error: null,
},
@@ -55,8 +55,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "->,a",
error: null,
},
@@ -67,6 +67,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "aaaaa",
generics: [],
+ typeFilter: -1,
}],
foundElems: 2,
original: "aaaaa->a",
@@ -76,8 +77,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "aaaaa->a",
error: null,
},
@@ -91,8 +92,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "!",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "-> !",
error: null,
},
diff --git a/tests/rustdoc-js-std/parser-separators.js b/tests/rustdoc-js-std/parser-separators.js
index 5b7abdfa8..fc8c5114c 100644
--- a/tests/rustdoc-js-std/parser-separators.js
+++ b/tests/rustdoc-js-std/parser-separators.js
@@ -19,6 +19,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'aaaaaa',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -26,12 +27,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "aaaaaa b",
returned: [],
- typeFilter: -1,
userQuery: "aaaaaa b",
error: null,
},
@@ -43,6 +44,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'a',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -50,12 +52,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a b",
returned: [],
- typeFilter: -1,
userQuery: "a b",
error: null,
},
@@ -67,6 +69,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'a',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -74,12 +77,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a,b",
returned: [],
- typeFilter: -1,
userQuery: "a,b",
error: null,
},
@@ -91,6 +94,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'a',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -98,12 +102,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a\tb",
returned: [],
- typeFilter: -1,
userQuery: "a\tb",
error: null,
},
@@ -130,12 +134,12 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: "a<b c>",
returned: [],
- typeFilter: -1,
userQuery: "a<b c>",
error: null,
},
@@ -162,12 +166,12 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: "a<b,c>",
returned: [],
- typeFilter: -1,
userQuery: "a<b,c>",
error: null,
},
@@ -194,12 +198,12 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: "a<b\tc>",
returned: [],
- typeFilter: -1,
userQuery: "a<b\tc>",
error: null,
},
diff --git a/tests/rustdoc-js-std/parser-weird-queries.js b/tests/rustdoc-js-std/parser-weird-queries.js
index a3d85aeca..dc1049a70 100644
--- a/tests/rustdoc-js-std/parser-weird-queries.js
+++ b/tests/rustdoc-js-std/parser-weird-queries.js
@@ -20,6 +20,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
},
{
name: "b",
@@ -27,12 +28,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "b",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a b",
returned: [],
- typeFilter: -1,
userQuery: "a b",
error: null,
},
@@ -44,6 +45,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
},
{
name: "b",
@@ -51,12 +53,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "b",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a b",
returned: [],
- typeFilter: -1,
userQuery: "a b",
error: null,
},
@@ -65,7 +67,6 @@ const PARSED = [
foundElems: 0,
original: "a,b(c)",
returned: [],
- typeFilter: -1,
userQuery: "a,b(c)",
error: "Unexpected `(`",
},
@@ -77,6 +78,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "aaa",
generics: [],
+ typeFilter: -1,
},
{
name: "a",
@@ -84,12 +86,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "aaa,a",
returned: [],
- typeFilter: -1,
userQuery: "aaa,a",
error: null,
},
@@ -98,7 +100,6 @@ const PARSED = [
foundElems: 0,
original: ",,,,",
returned: [],
- typeFilter: -1,
userQuery: ",,,,",
error: null,
},
@@ -107,17 +108,15 @@ const PARSED = [
foundElems: 0,
original: 'mod :',
returned: [],
- typeFilter: 0,
userQuery: 'mod :',
- error: null,
+ error: "Unexpected `:` (expected path after type filter)",
},
{
elems: [],
foundElems: 0,
original: 'mod\t:',
returned: [],
- typeFilter: 0,
userQuery: 'mod\t:',
- error: null,
+ error: "Unexpected `:` (expected path after type filter)",
},
];
diff --git a/tests/rustdoc-js-std/println-typo.js b/tests/rustdoc-js-std/println-typo.js
new file mode 100644
index 000000000..7ca3ab8e5
--- /dev/null
+++ b/tests/rustdoc-js-std/println-typo.js
@@ -0,0 +1,12 @@
+// exact-check
+
+const QUERY = 'prinltn';
+const FILTER_CRATE = 'std';
+
+const EXPECTED = {
+ 'others': [
+ { 'path': 'std', 'name': 'println' },
+ { 'path': 'std', 'name': 'print' },
+ { 'path': 'std', 'name': 'eprintln' },
+ ],
+};