rust/src/test/rustdoc-js-std/parser-errors.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

192 lines
4.0 KiB
JavaScript
Raw Normal View History

const QUERY = [
'<"P">',
'"P" "P"',
'P "P"',
'"p" p',
'"const": p',
"<:a>", "<::a>",
"((a))",
"->,a",
"(p -> p",
"::a::b",
"a::::b",
"a::b::",
":a",
"a b:",
"a (b:",
"{:",
];
2021-12-20 16:45:52 +00:00
const PARSED = [
{
args: [],
elems: [],
foundElems: 0,
original: "<\"P\">",
returned: [],
typeFilter: -1,
2022-01-03 15:43:30 +00:00
userQuery: "<\"p\">",
2021-12-20 16:45:52 +00:00
error: "`\"` cannot be used in generics",
},
{
args: [],
elems: [],
foundElems: 0,
original: "\"P\" \"P\"",
returned: [],
typeFilter: -1,
2022-01-03 15:43:30 +00:00
userQuery: "\"p\" \"p\"",
2021-12-20 16:45:52 +00:00
error: "Cannot have more than one literal search element",
},
{
args: [],
elems: [],
foundElems: 0,
original: "P \"P\"",
returned: [],
typeFilter: -1,
2022-01-03 15:43:30 +00:00
userQuery: "p \"p\"",
2021-12-20 16:45:52 +00:00
error: "Cannot use literal search when there is more than one element",
},
{
args: [],
elems: [],
foundElems: 0,
original: "\"p\" p",
returned: [],
typeFilter: -1,
userQuery: "\"p\" p",
error: "You cannot have more than one element if you use quotes",
},
{
args: [],
elems: [],
foundElems: 0,
original: "\"const\": p",
returned: [],
typeFilter: -1,
userQuery: "\"const\": p",
error: "You cannot use quotes on type filter",
},
{
args: [],
elems: [],
foundElems: 0,
original: "<:a>",
returned: [],
typeFilter: -1,
userQuery: "<:a>",
error: "Unexpected `:` after `<`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "<::a>",
returned: [],
typeFilter: -1,
userQuery: "<::a>",
error: "Unexpected `::`: paths cannot start with `::`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "((a))",
returned: [],
typeFilter: -1,
userQuery: "((a))",
error: "Unexpected `(` after `(`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "->,a",
returned: [],
typeFilter: -1,
userQuery: "->,a",
error: "Unexpected `,` after `->`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "(p -> p",
returned: [],
typeFilter: -1,
userQuery: "(p -> p",
error: "Unexpected `-` after `(`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "::a::b",
returned: [],
typeFilter: -1,
userQuery: "::a::b",
error: "Paths cannot start with `::`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "a::::b",
returned: [],
typeFilter: -1,
userQuery: "a::::b",
error: "Unexpected `::::`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "a::b::",
returned: [],
typeFilter: -1,
userQuery: "a::b::",
error: "Paths cannot end with `::`",
},
{
args: [],
elems: [],
foundElems: 0,
original: ":a",
returned: [],
typeFilter: -1,
userQuery: ":a",
error: "Expected type filter before `:`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "a b:",
returned: [],
typeFilter: -1,
userQuery: "a b:",
error: "Unexpected `:`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "a (b:",
returned: [],
typeFilter: -1,
userQuery: "a (b:",
error: "Unexpected `:` after `(`",
},
{
args: [],
elems: [],
foundElems: 0,
original: "{:",
returned: [],
typeFilter: -1,
userQuery: "{:",
error: "Unknown type filter `{`",
},
2021-12-20 16:45:52 +00:00
];