about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-13 14:01:01 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-14 14:22:17 +0200
commite4ee3298656b74dd6be810862b5dd4cb8d2825b8 (patch)
tree0e7932afdea90ae0bb6098bd94c32b00d8cf3b95 /tests/rustdoc-js-std/parser-errors.js
parent4f0a9124bdfb84e71bde8e9d0b79d688baf7887f (diff)
downloadrust-e4ee3298656b74dd6be810862b5dd4cb8d2825b8.tar.gz
rust-e4ee3298656b74dd6be810862b5dd4cb8d2825b8.zip
Fix eBNF and handling of whitespace characters when not in a path
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
-rw-r--r--tests/rustdoc-js-std/parser-errors.js106
1 files changed, 105 insertions, 1 deletions
diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js
index 66b0e516b2b..b32bfea5439 100644
--- a/tests/rustdoc-js-std/parser-errors.js
+++ b/tests/rustdoc-js-std/parser-errors.js
@@ -366,7 +366,7 @@ const PARSED = [
         original: "a<>  :",
         returned: [],
         userQuery: "a<>  :",
-        error: 'Expected `,`, `:` or `->` after `>`, found ` `',
+        error: 'Unexpected `<` in type filter (before `:`)',
     },
     {
         query: "mod : :",
@@ -440,4 +440,108 @@ const PARSED = [
         userQuery: "a<",
         error: "Unclosed `<`",
     },
+    {
+        query: "p<x> , y",
+        elems: [
+            {
+                name: "p",
+                fullPath: ["p"],
+                pathWithoutLast: [],
+                pathLast: "p",
+                generics: [
+                    {
+                        name: "x",
+                        fullPath: ["x"],
+                        pathWithoutLast: [],
+                        pathLast: "x",
+                        generics: [],
+                        typeFilter: -1,
+                    },
+                ],
+                typeFilter: -1,
+            },
+            {
+                name: "y",
+                fullPath: ["y"],
+                pathWithoutLast: [],
+                pathLast: "y",
+                generics: [],
+                typeFilter: -1,
+            },
+        ],
+        foundElems: 2,
+        original: "p<x> , y",
+        returned: [],
+        userQuery: "p<x> , y",
+        error: null,
+    },
+    {
+        query: "p<x , y>",
+        elems: [
+            {
+                name: "p",
+                fullPath: ["p"],
+                pathWithoutLast: [],
+                pathLast: "p",
+                generics: [
+                    {
+                        name: "x",
+                        fullPath: ["x"],
+                        pathWithoutLast: [],
+                        pathLast: "x",
+                        generics: [],
+                        typeFilter: -1,
+                    },
+                    {
+                        name: "y",
+                        fullPath: ["y"],
+                        pathWithoutLast: [],
+                        pathLast: "y",
+                        generics: [],
+                        typeFilter: -1,
+                    },
+                ],
+                typeFilter: -1,
+            },
+        ],
+        foundElems: 1,
+        original: "p<x , y>",
+        returned: [],
+        userQuery: "p<x , y>",
+        error: null,
+    },
+    {
+        query: "p ,x , y",
+        elems: [
+            {
+                name: "p",
+                fullPath: ["p"],
+                pathWithoutLast: [],
+                pathLast: "p",
+                generics: [],
+                typeFilter: -1,
+            },
+            {
+                name: "x",
+                fullPath: ["x"],
+                pathWithoutLast: [],
+                pathLast: "x",
+                generics: [],
+                typeFilter: -1,
+            },
+            {
+                name: "y",
+                fullPath: ["y"],
+                pathWithoutLast: [],
+                pathLast: "y",
+                generics: [],
+                typeFilter: -1,
+            },
+        ],
+        foundElems: 3,
+        original: "p ,x , y",
+        returned: [],
+        userQuery: "p ,x , y",
+        error: null,
+    },
 ];