about summary refs log tree commit diff
path: root/src/test/rustdoc-js-std/parser-paths.js
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-12-20 17:45:52 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-04-18 20:59:08 +0200
commitf5833e759ecd55c03afeb918263cb35fabc91177 (patch)
treef339a8d44570204e26687434d7f89eb05946062f /src/test/rustdoc-js-std/parser-paths.js
parent7cefee027ae8937058e4109911a4ded2e643399b (diff)
downloadrust-f5833e759ecd55c03afeb918263cb35fabc91177.tar.gz
rust-f5833e759ecd55c03afeb918263cb35fabc91177.zip
Add parser tests
Diffstat (limited to 'src/test/rustdoc-js-std/parser-paths.js')
-rw-r--r--src/test/rustdoc-js-std/parser-paths.js106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/test/rustdoc-js-std/parser-paths.js b/src/test/rustdoc-js-std/parser-paths.js
new file mode 100644
index 00000000000..9422eada9bc
--- /dev/null
+++ b/src/test/rustdoc-js-std/parser-paths.js
@@ -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,
+    },
+];