Add parser tests
This commit is contained in:
106
src/test/rustdoc-js-std/parser-paths.js
Normal file
106
src/test/rustdoc-js-std/parser-paths.js
Normal file
@@ -0,0 +1,106 @@
|
||||
const QUERY = ['A::B', '::A::B', 'A::B::,C', 'A::B::<f>,C'];
|
||||
|
||||
const PARSED = [
|
||||
{
|
||||
args: [],
|
||||
elemName: null,
|
||||
elems: [{
|
||||
name: "a::b",
|
||||
fullPath: ["a", "b"],
|
||||
pathWithoutLast: ["a"],
|
||||
pathLast: "b",
|
||||
generics: [],
|
||||
}],
|
||||
foundElems: 1,
|
||||
id: "A::B",
|
||||
nameSplit: null,
|
||||
original: "A::B",
|
||||
returned: [],
|
||||
typeFilter: -1,
|
||||
val: "a::b",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
args: [],
|
||||
elemName: null,
|
||||
elems: [{
|
||||
name: "::a::b",
|
||||
fullPath: ["a", "b"],
|
||||
pathWithoutLast: ["a"],
|
||||
pathLast: "b",
|
||||
generics: [],
|
||||
}],
|
||||
foundElems: 1,
|
||||
id: '::A::B',
|
||||
nameSplit: null,
|
||||
original: '::A::B',
|
||||
returned: [],
|
||||
typeFilter: -1,
|
||||
val: '::a::b',
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
args: [],
|
||||
elemName: null,
|
||||
elems: [
|
||||
{
|
||||
name: "a::b::",
|
||||
fullPath: ["a", "b"],
|
||||
pathWithoutLast: ["a"],
|
||||
pathLast: "b",
|
||||
generics: [],
|
||||
},
|
||||
{
|
||||
name: "c",
|
||||
fullPath: ["c"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "c",
|
||||
generics: [],
|
||||
},
|
||||
],
|
||||
foundElems: 2,
|
||||
id: 'A::B::,C',
|
||||
nameSplit: null,
|
||||
original: 'A::B::,C',
|
||||
returned: [],
|
||||
typeFilter: -1,
|
||||
val: 'a::b::,c',
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
args: [],
|
||||
elemName: null,
|
||||
elems: [
|
||||
{
|
||||
name: "a::b::",
|
||||
fullPath: ["a", "b"],
|
||||
pathWithoutLast: ["a"],
|
||||
pathLast: "b",
|
||||
generics: [
|
||||
{
|
||||
name: "f",
|
||||
fullPath: ["f"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "f",
|
||||
generics: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "c",
|
||||
fullPath: ["c"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "c",
|
||||
generics: [],
|
||||
},
|
||||
],
|
||||
foundElems: 2,
|
||||
id: 'A::B::<f>,C',
|
||||
nameSplit: null,
|
||||
original: 'A::B::<f>,C',
|
||||
returned: [],
|
||||
typeFilter: -1,
|
||||
val: 'a::b::<f>,c',
|
||||
error: null,
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user