2021-12-20 16:45:52 +00:00
|
|
|
// This test is mostly to check that the parser still kinda outputs something
|
|
|
|
// (and doesn't enter an infinite loop!) even though the query is completely
|
|
|
|
// invalid.
|
|
|
|
|
|
|
|
const PARSED = [
|
|
|
|
{
|
2023-06-09 14:49:38 +00:00
|
|
|
query: 'a b',
|
2022-01-09 14:12:46 +00:00
|
|
|
elems: [
|
2021-12-20 16:45:52 +00:00
|
|
|
{
|
2023-06-12 14:05:00 +00:00
|
|
|
name: "a b",
|
|
|
|
fullPath: ["a", "b"],
|
|
|
|
pathWithoutLast: ["a"],
|
2022-01-09 14:12:46 +00:00
|
|
|
pathLast: "b",
|
2021-12-20 16:45:52 +00:00
|
|
|
generics: [],
|
|
|
|
},
|
|
|
|
],
|
2023-06-12 14:05:00 +00:00
|
|
|
foundElems: 1,
|
2022-01-09 14:12:46 +00:00
|
|
|
original: "a b",
|
2021-12-20 16:45:52 +00:00
|
|
|
returned: [],
|
2022-01-09 14:12:46 +00:00
|
|
|
userQuery: "a b",
|
2021-12-20 16:45:52 +00:00
|
|
|
error: null,
|
|
|
|
},
|
|
|
|
{
|
2023-06-09 14:49:38 +00:00
|
|
|
query: 'a b',
|
2021-12-20 16:45:52 +00:00
|
|
|
elems: [
|
|
|
|
{
|
2023-06-12 14:05:00 +00:00
|
|
|
name: "a b",
|
|
|
|
fullPath: ["a", "b"],
|
|
|
|
pathWithoutLast: ["a"],
|
2022-01-09 14:12:46 +00:00
|
|
|
pathLast: "b",
|
2021-12-20 16:45:52 +00:00
|
|
|
generics: [],
|
|
|
|
},
|
|
|
|
],
|
2023-06-12 14:05:00 +00:00
|
|
|
foundElems: 1,
|
2022-01-09 14:12:46 +00:00
|
|
|
original: "a b",
|
2021-12-20 16:45:52 +00:00
|
|
|
returned: [],
|
2022-01-09 14:12:46 +00:00
|
|
|
userQuery: "a b",
|
2021-12-20 16:45:52 +00:00
|
|
|
error: null,
|
|
|
|
},
|
2022-03-28 14:14:00 +00:00
|
|
|
{
|
2023-06-09 14:49:38 +00:00
|
|
|
query: 'aaa,a',
|
2022-03-28 14:14:00 +00:00
|
|
|
elems: [
|
|
|
|
{
|
|
|
|
name: "aaa",
|
|
|
|
fullPath: ["aaa"],
|
|
|
|
pathWithoutLast: [],
|
|
|
|
pathLast: "aaa",
|
|
|
|
generics: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "a",
|
|
|
|
fullPath: ["a"],
|
|
|
|
pathWithoutLast: [],
|
|
|
|
pathLast: "a",
|
|
|
|
generics: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
foundElems: 2,
|
|
|
|
original: "aaa,a",
|
|
|
|
returned: [],
|
|
|
|
userQuery: "aaa,a",
|
|
|
|
error: null,
|
|
|
|
},
|
2022-04-16 23:43:26 +00:00
|
|
|
{
|
2023-06-09 14:49:38 +00:00
|
|
|
query: ',,,,',
|
2022-04-16 23:43:26 +00:00
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: ",,,,",
|
|
|
|
returned: [],
|
|
|
|
userQuery: ",,,,",
|
|
|
|
error: null,
|
|
|
|
},
|
2022-04-17 10:05:31 +00:00
|
|
|
{
|
2023-06-09 14:49:38 +00:00
|
|
|
query: 'mod :',
|
2022-04-17 10:05:31 +00:00
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: 'mod :',
|
|
|
|
returned: [],
|
|
|
|
userQuery: 'mod :',
|
2023-06-12 14:05:00 +00:00
|
|
|
error: "Unexpected `:` (expected path after type filter `mod:`)",
|
2022-04-17 10:05:31 +00:00
|
|
|
},
|
|
|
|
{
|
2023-06-09 14:49:38 +00:00
|
|
|
query: 'mod\t:',
|
2022-04-17 10:05:31 +00:00
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
2023-11-29 17:54:49 +00:00
|
|
|
original: 'mod :',
|
2022-04-17 10:05:31 +00:00
|
|
|
returned: [],
|
2023-11-29 17:54:49 +00:00
|
|
|
userQuery: 'mod :',
|
2023-06-12 14:05:00 +00:00
|
|
|
error: "Unexpected `:` (expected path after type filter `mod:`)",
|
2022-04-17 10:05:31 +00:00
|
|
|
},
|
2021-12-20 16:45:52 +00:00
|
|
|
];
|