about summary refs log tree commit diff
path: root/tests/rustdoc-js/generics-nested.js
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-03-30 21:53:11 -0700
committerMichael Howell <michael@notriddle.com>2023-04-14 14:55:45 -0700
commitafee2411e3fd5c6e8b3301fa748a760e01615904 (patch)
treeacfe106f4aa933d1a4a76f5e1b9104924cfcec25 /tests/rustdoc-js/generics-nested.js
parent276fa294809e914b1d04192392d256814aa5ce1a (diff)
downloadrust-afee2411e3fd5c6e8b3301fa748a760e01615904.tar.gz
rust-afee2411e3fd5c6e8b3301fa748a760e01615904.zip
rustdoc-search: add support for nested generics
Diffstat (limited to 'tests/rustdoc-js/generics-nested.js')
-rw-r--r--tests/rustdoc-js/generics-nested.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/rustdoc-js/generics-nested.js b/tests/rustdoc-js/generics-nested.js
new file mode 100644
index 00000000000..8701f2d4986
--- /dev/null
+++ b/tests/rustdoc-js/generics-nested.js
@@ -0,0 +1,33 @@
+// exact-check
+
+const QUERY = [
+    '-> Out<First<Second>>',
+    '-> Out<Second<First>>',
+    '-> Out<First, Second>',
+    '-> Out<Second, First>',
+];
+
+const EXPECTED = [
+    {
+        // -> Out<First<Second>>
+        'others': [
+            { 'path': 'generics_nested', 'name': 'alef' },
+        ],
+    },
+    {
+        // -> Out<Second<First>>
+        'others': [],
+    },
+    {
+        // -> Out<First, Second>
+        'others': [
+            { 'path': 'generics_nested', 'name': 'bet' },
+        ],
+    },
+    {
+        // -> Out<Second, First>
+        'others': [
+            { 'path': 'generics_nested', 'name': 'bet' },
+        ],
+    },
+];