Update rustdoc search test to check !
This commit is contained in:
parent
45cdb2be10
commit
4ea149905b
3 changed files with 135 additions and 1 deletions
|
@ -35,6 +35,8 @@ const QUERY = [
|
||||||
"a,:",
|
"a,:",
|
||||||
" a<> :",
|
" a<> :",
|
||||||
"mod : :",
|
"mod : :",
|
||||||
|
"a!a",
|
||||||
|
"a!!",
|
||||||
];
|
];
|
||||||
|
|
||||||
const PARSED = [
|
const PARSED = [
|
||||||
|
@ -362,4 +364,22 @@ const PARSED = [
|
||||||
userQuery: "mod : :",
|
userQuery: "mod : :",
|
||||||
error: 'Unexpected `:`',
|
error: 'Unexpected `:`',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
elems: [],
|
||||||
|
foundElems: 0,
|
||||||
|
original: "a!a",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "a!a",
|
||||||
|
error: '`!` can only be at the end of an ident',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elems: [],
|
||||||
|
foundElems: 0,
|
||||||
|
original: "a!!",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "a!!",
|
||||||
|
error: 'Cannot have more than one `!` in an ident',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
93
src/test/rustdoc-js-std/parser-ident.js
Normal file
93
src/test/rustdoc-js-std/parser-ident.js
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
const QUERY = [
|
||||||
|
"R<!>",
|
||||||
|
"!",
|
||||||
|
"a!",
|
||||||
|
"a!::b",
|
||||||
|
"a!::b!",
|
||||||
|
];
|
||||||
|
|
||||||
|
const PARSED = [
|
||||||
|
{
|
||||||
|
elems: [{
|
||||||
|
name: "r",
|
||||||
|
fullPath: ["r"],
|
||||||
|
pathWithoutLast: [],
|
||||||
|
pathLast: "r",
|
||||||
|
generics: [
|
||||||
|
{
|
||||||
|
name: "!",
|
||||||
|
fullPath: ["!"],
|
||||||
|
pathWithoutLast: [],
|
||||||
|
pathLast: "!",
|
||||||
|
generics: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
foundElems: 1,
|
||||||
|
original: "R<!>",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "r<!>",
|
||||||
|
error: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elems: [{
|
||||||
|
name: "!",
|
||||||
|
fullPath: ["!"],
|
||||||
|
pathWithoutLast: [],
|
||||||
|
pathLast: "!",
|
||||||
|
generics: [],
|
||||||
|
}],
|
||||||
|
foundElems: 1,
|
||||||
|
original: "!",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "!",
|
||||||
|
error: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elems: [{
|
||||||
|
name: "a!",
|
||||||
|
fullPath: ["a!"],
|
||||||
|
pathWithoutLast: [],
|
||||||
|
pathLast: "a!",
|
||||||
|
generics: [],
|
||||||
|
}],
|
||||||
|
foundElems: 1,
|
||||||
|
original: "a!",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "a!",
|
||||||
|
error: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elems: [{
|
||||||
|
name: "a!::b",
|
||||||
|
fullPath: ["a!", "b"],
|
||||||
|
pathWithoutLast: ["a!"],
|
||||||
|
pathLast: "b",
|
||||||
|
generics: [],
|
||||||
|
}],
|
||||||
|
foundElems: 1,
|
||||||
|
original: "a!::b",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "a!::b",
|
||||||
|
error: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elems: [{
|
||||||
|
name: "a!::b!",
|
||||||
|
fullPath: ["a!", "b!"],
|
||||||
|
pathWithoutLast: ["a!"],
|
||||||
|
pathLast: "b!",
|
||||||
|
generics: [],
|
||||||
|
}],
|
||||||
|
foundElems: 1,
|
||||||
|
original: "a!::b!",
|
||||||
|
returned: [],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "a!::b!",
|
||||||
|
error: null,
|
||||||
|
},
|
||||||
|
];
|
|
@ -1,4 +1,10 @@
|
||||||
const QUERY = ['-> F<P>', '-> P', '->,a', 'aaaaa->a'];
|
const QUERY = [
|
||||||
|
"-> F<P>",
|
||||||
|
"-> P",
|
||||||
|
"->,a",
|
||||||
|
"aaaaa->a",
|
||||||
|
"-> !",
|
||||||
|
];
|
||||||
|
|
||||||
const PARSED = [
|
const PARSED = [
|
||||||
{
|
{
|
||||||
|
@ -75,4 +81,19 @@ const PARSED = [
|
||||||
userQuery: "aaaaa->a",
|
userQuery: "aaaaa->a",
|
||||||
error: null,
|
error: null,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
elems: [],
|
||||||
|
foundElems: 1,
|
||||||
|
original: "-> !",
|
||||||
|
returned: [{
|
||||||
|
name: "!",
|
||||||
|
fullPath: ["!"],
|
||||||
|
pathWithoutLast: [],
|
||||||
|
pathLast: "!",
|
||||||
|
generics: [],
|
||||||
|
}],
|
||||||
|
typeFilter: -1,
|
||||||
|
userQuery: "-> !",
|
||||||
|
error: null,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue