summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-js-std/parser-weird-queries.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/rustdoc-js-std/parser-weird-queries.js
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-js-std/parser-weird-queries.js')
-rw-r--r--tests/rustdoc-js-std/parser-weird-queries.js56
1 files changed, 17 insertions, 39 deletions
diff --git a/tests/rustdoc-js-std/parser-weird-queries.js b/tests/rustdoc-js-std/parser-weird-queries.js
index dc1049a70..720ef66c1 100644
--- a/tests/rustdoc-js-std/parser-weird-queries.js
+++ b/tests/rustdoc-js-std/parser-weird-queries.js
@@ -1,68 +1,44 @@
// 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 QUERY = [
- 'a b',
- 'a b',
- 'a,b(c)',
- 'aaa,a',
- ',,,,',
- 'mod :',
- 'mod\t:',
-];
const PARSED = [
{
+ query: 'a b',
elems: [
{
- name: "a",
- fullPath: ["a"],
- pathWithoutLast: [],
- pathLast: "a",
- generics: [],
- typeFilter: -1,
- },
- {
- name: "b",
- fullPath: ["b"],
- pathWithoutLast: [],
+ name: "a b",
+ fullPath: ["a", "b"],
+ pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
- typeFilter: -1,
},
],
- foundElems: 2,
+ foundElems: 1,
original: "a b",
returned: [],
userQuery: "a b",
error: null,
},
{
+ query: 'a b',
elems: [
{
- name: "a",
- fullPath: ["a"],
- pathWithoutLast: [],
- pathLast: "a",
- generics: [],
- typeFilter: -1,
- },
- {
- name: "b",
- fullPath: ["b"],
- pathWithoutLast: [],
+ name: "a b",
+ fullPath: ["a", "b"],
+ pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
- typeFilter: -1,
},
],
- foundElems: 2,
+ foundElems: 1,
original: "a b",
returned: [],
userQuery: "a b",
error: null,
},
{
+ query: 'a,b(c)',
elems: [],
foundElems: 0,
original: "a,b(c)",
@@ -71,6 +47,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: 'aaa,a',
elems: [
{
name: "aaa",
@@ -78,7 +55,6 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "aaa",
generics: [],
- typeFilter: -1,
},
{
name: "a",
@@ -86,7 +62,6 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
- typeFilter: -1,
},
],
foundElems: 2,
@@ -96,6 +71,7 @@ const PARSED = [
error: null,
},
{
+ query: ',,,,',
elems: [],
foundElems: 0,
original: ",,,,",
@@ -104,19 +80,21 @@ const PARSED = [
error: null,
},
{
+ query: 'mod :',
elems: [],
foundElems: 0,
original: 'mod :',
returned: [],
userQuery: 'mod :',
- error: "Unexpected `:` (expected path after type filter)",
+ error: "Unexpected `:` (expected path after type filter `mod:`)",
},
{
+ query: 'mod\t:',
elems: [],
foundElems: 0,
original: 'mod\t:',
returned: [],
userQuery: 'mod\t:',
- error: "Unexpected `:` (expected path after type filter)",
+ error: "Unexpected `:` (expected path after type filter `mod:`)",
},
];