2021-12-20 10:45:52 -06: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.
|
2022-04-16 18:43:26 -05:00
|
|
|
const QUERY = [
|
|
|
|
'a b',
|
|
|
|
'a b',
|
|
|
|
'a,b(c)',
|
|
|
|
'aaa,a',
|
|
|
|
',,,,',
|
2022-04-17 05:05:31 -05:00
|
|
|
'mod :',
|
|
|
|
'mod\t:',
|
2022-04-16 18:43:26 -05:00
|
|
|
];
|
2021-12-20 10:45:52 -06:00
|
|
|
|
|
|
|
const PARSED = [
|
|
|
|
{
|
2022-01-09 08:12:46 -06:00
|
|
|
elems: [
|
2021-12-20 10:45:52 -06:00
|
|
|
{
|
2022-01-09 08:12:46 -06:00
|
|
|
name: "a",
|
|
|
|
fullPath: ["a"],
|
2021-12-20 10:45:52 -06:00
|
|
|
pathWithoutLast: [],
|
2022-01-09 08:12:46 -06:00
|
|
|
pathLast: "a",
|
2021-12-20 10:45:52 -06:00
|
|
|
generics: [],
|
2023-02-28 19:17:59 -06:00
|
|
|
typeFilter: -1,
|
2021-12-20 10:45:52 -06:00
|
|
|
},
|
|
|
|
{
|
2022-01-09 08:12:46 -06:00
|
|
|
name: "b",
|
|
|
|
fullPath: ["b"],
|
2021-12-20 10:45:52 -06:00
|
|
|
pathWithoutLast: [],
|
2022-01-09 08:12:46 -06:00
|
|
|
pathLast: "b",
|
2021-12-20 10:45:52 -06:00
|
|
|
generics: [],
|
2023-02-28 19:17:59 -06:00
|
|
|
typeFilter: -1,
|
2021-12-20 10:45:52 -06:00
|
|
|
},
|
|
|
|
],
|
|
|
|
foundElems: 2,
|
2022-01-09 08:12:46 -06:00
|
|
|
original: "a b",
|
2021-12-20 10:45:52 -06:00
|
|
|
returned: [],
|
2022-01-09 08:12:46 -06:00
|
|
|
userQuery: "a b",
|
2021-12-20 10:45:52 -06:00
|
|
|
error: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
elems: [
|
|
|
|
{
|
2022-01-09 08:12:46 -06:00
|
|
|
name: "a",
|
|
|
|
fullPath: ["a"],
|
|
|
|
pathWithoutLast: [],
|
|
|
|
pathLast: "a",
|
|
|
|
generics: [],
|
2023-02-28 19:17:59 -06:00
|
|
|
typeFilter: -1,
|
2022-01-09 08:12:46 -06:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "b",
|
|
|
|
fullPath: ["b"],
|
2021-12-20 10:45:52 -06:00
|
|
|
pathWithoutLast: [],
|
2022-01-09 08:12:46 -06:00
|
|
|
pathLast: "b",
|
2021-12-20 10:45:52 -06:00
|
|
|
generics: [],
|
2023-02-28 19:17:59 -06:00
|
|
|
typeFilter: -1,
|
2021-12-20 10:45:52 -06:00
|
|
|
},
|
|
|
|
],
|
2022-01-09 08:12:46 -06:00
|
|
|
foundElems: 2,
|
|
|
|
original: "a b",
|
2021-12-20 10:45:52 -06:00
|
|
|
returned: [],
|
2022-01-09 08:12:46 -06:00
|
|
|
userQuery: "a b",
|
2021-12-20 10:45:52 -06:00
|
|
|
error: null,
|
|
|
|
},
|
|
|
|
{
|
2022-02-09 13:56:37 -06:00
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
2021-12-20 10:45:52 -06:00
|
|
|
original: "a,b(c)",
|
|
|
|
returned: [],
|
2022-01-03 09:43:30 -06:00
|
|
|
userQuery: "a,b(c)",
|
2022-02-09 13:56:37 -06:00
|
|
|
error: "Unexpected `(`",
|
2021-12-20 10:45:52 -06:00
|
|
|
},
|
2022-03-28 09:14:00 -05:00
|
|
|
{
|
|
|
|
elems: [
|
|
|
|
{
|
|
|
|
name: "aaa",
|
|
|
|
fullPath: ["aaa"],
|
|
|
|
pathWithoutLast: [],
|
|
|
|
pathLast: "aaa",
|
|
|
|
generics: [],
|
2023-02-28 19:17:59 -06:00
|
|
|
typeFilter: -1,
|
2022-03-28 09:14:00 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "a",
|
|
|
|
fullPath: ["a"],
|
|
|
|
pathWithoutLast: [],
|
|
|
|
pathLast: "a",
|
|
|
|
generics: [],
|
2023-02-28 19:17:59 -06:00
|
|
|
typeFilter: -1,
|
2022-03-28 09:14:00 -05:00
|
|
|
},
|
|
|
|
],
|
|
|
|
foundElems: 2,
|
|
|
|
original: "aaa,a",
|
|
|
|
returned: [],
|
|
|
|
userQuery: "aaa,a",
|
|
|
|
error: null,
|
|
|
|
},
|
2022-04-16 18:43:26 -05:00
|
|
|
{
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: ",,,,",
|
|
|
|
returned: [],
|
|
|
|
userQuery: ",,,,",
|
|
|
|
error: null,
|
|
|
|
},
|
2022-04-17 05:05:31 -05:00
|
|
|
{
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: 'mod :',
|
|
|
|
returned: [],
|
|
|
|
userQuery: 'mod :',
|
2023-02-28 19:17:59 -06:00
|
|
|
error: "Unexpected `:` (expected path after type filter)",
|
2022-04-17 05:05:31 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: 'mod\t:',
|
|
|
|
returned: [],
|
|
|
|
userQuery: 'mod\t:',
|
2023-02-28 19:17:59 -06:00
|
|
|
error: "Unexpected `:` (expected path after type filter)",
|
2022-04-17 05:05:31 -05:00
|
|
|
},
|
2021-12-20 10:45:52 -06:00
|
|
|
];
|