about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-paths.js
diff options
context:
space:
mode:
authoryanchith <yanchi.toth@gmail.com>2023-06-09 11:22:08 +0200
committeryanchith <yanchi.toth@gmail.com>2023-06-09 11:22:08 +0200
commitcb5c011670ce8d073d0aae8c45e73c20593bfa11 (patch)
treea11259b0350c7bfc4e4c642e8e00b5cd6e901444 /tests/rustdoc-js-std/parser-paths.js
parent24df5f28e12c6ca4c1c6ef36f6d42f376c6060c3 (diff)
parent9c843d9fa322596c7d525c78fa89731ecf7afbfe (diff)
downloadrust-cb5c011670ce8d073d0aae8c45e73c20593bfa11.tar.gz
rust-cb5c011670ce8d073d0aae8c45e73c20593bfa11.zip
Merge branch 'master' into binary-heap-ta
Diffstat (limited to 'tests/rustdoc-js-std/parser-paths.js')
-rw-r--r--tests/rustdoc-js-std/parser-paths.js92
1 files changed, 92 insertions, 0 deletions
diff --git a/tests/rustdoc-js-std/parser-paths.js b/tests/rustdoc-js-std/parser-paths.js
new file mode 100644
index 00000000000..f3e421f5ffa
--- /dev/null
+++ b/tests/rustdoc-js-std/parser-paths.js
@@ -0,0 +1,92 @@
+const QUERY = ['A::B', 'A::B,C',  'A::B<f>,C', 'mod::a'];
+
+const PARSED = [
+    {
+        elems: [{
+            name: "a::b",
+            fullPath: ["a", "b"],
+            pathWithoutLast: ["a"],
+            pathLast: "b",
+            generics: [],
+            typeFilter: -1,
+        }],
+        foundElems: 1,
+        original: "A::B",
+        returned: [],
+        userQuery: "a::b",
+        error: null,
+    },
+    {
+        elems: [
+            {
+                name: "a::b",
+                fullPath: ["a", "b"],
+                pathWithoutLast: ["a"],
+                pathLast: "b",
+                generics: [],
+                typeFilter: -1,
+            },
+            {
+                name: "c",
+                fullPath: ["c"],
+                pathWithoutLast: [],
+                pathLast: "c",
+                generics: [],
+                typeFilter: -1,
+            },
+        ],
+        foundElems: 2,
+        original: 'A::B,C',
+        returned: [],
+        userQuery: 'a::b,c',
+        error: null,
+    },
+    {
+        elems: [
+            {
+                name: "a::b",
+                fullPath: ["a", "b"],
+                pathWithoutLast: ["a"],
+                pathLast: "b",
+                generics: [
+                    {
+                        name: "f",
+                        fullPath: ["f"],
+                        pathWithoutLast: [],
+                        pathLast: "f",
+                        generics: [],
+                    },
+                ],
+                typeFilter: -1,
+            },
+            {
+                name: "c",
+                fullPath: ["c"],
+                pathWithoutLast: [],
+                pathLast: "c",
+                generics: [],
+                typeFilter: -1,
+            },
+        ],
+        foundElems: 2,
+        original: 'A::B<f>,C',
+        returned: [],
+        userQuery: 'a::b<f>,c',
+        error: null,
+    },
+    {
+        elems: [{
+            name: "mod::a",
+            fullPath: ["mod", "a"],
+            pathWithoutLast: ["mod"],
+            pathLast: "a",
+            generics: [],
+            typeFilter: -1,
+        }],
+        foundElems: 1,
+        original: "mod::a",
+        returned: [],
+        userQuery: "mod::a",
+        error: null,
+    },
+];