rust/tests/rustdoc-js-std/parser-quote.js
2023-06-14 14:22:17 +02:00

80 lines
1.7 KiB
JavaScript

const PARSED = [
{
query: '-> "p"',
elems: [],
foundElems: 1,
original: '-> "p"',
returned: [{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [],
typeFilter: -1,
}],
userQuery: '-> "p"',
error: null,
},
{
query: '"p",',
elems: [{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [],
typeFilter: -1,
}],
foundElems: 1,
original: '"p",',
returned: [],
userQuery: '"p",',
error: null,
},
{
query: '"p" -> a',
elems: [],
foundElems: 0,
original: '"p" -> a',
returned: [],
userQuery: '"p" -> a',
error: "Cannot have more than one element if you use quotes",
},
{
query: '"a" -> "p"',
elems: [],
foundElems: 0,
original: '"a" -> "p"',
returned: [],
userQuery: '"a" -> "p"',
error: "Cannot have more than one literal search element",
},
{
query: '->"-"',
elems: [],
foundElems: 0,
original: '->"-"',
returned: [],
userQuery: '->"-"',
error: 'Unexpected `-` in a string element',
},
{
query: '"a',
elems: [],
foundElems: 0,
original: '"a',
returned: [],
userQuery: '"a',
error: 'Unclosed `"`',
},
{
query: '""',
elems: [],
foundElems: 0,
original: '""',
returned: [],
userQuery: '""',
error: 'Cannot have empty string element',
},
];