about summary refs log tree commit diff
path: root/src/test/rustdoc-js
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-01-30 17:39:44 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2021-02-01 15:56:51 +0100
commitd5243e3a973899e0f12c0c11f2175ed9ead665a8 (patch)
tree55d48ea6b11088cc25e4e2d2bb227b49802bdadb /src/test/rustdoc-js
parent198e3aba8f00bc086ed6020f6420064e26a820c7 (diff)
downloadrust-d5243e3a973899e0f12c0c11f2175ed9ead665a8.tar.gz
rust-d5243e3a973899e0f12c0c11f2175ed9ead665a8.zip
Add test for primitive search
Diffstat (limited to 'src/test/rustdoc-js')
-rw-r--r--src/test/rustdoc-js/primitive.js25
-rw-r--r--src/test/rustdoc-js/primitive.rs5
2 files changed, 30 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/primitive.js b/src/test/rustdoc-js/primitive.js
new file mode 100644
index 00000000000..918f7099918
--- /dev/null
+++ b/src/test/rustdoc-js/primitive.js
@@ -0,0 +1,25 @@
+// exact-check
+
+const QUERY = [
+    "i32",
+    "str",
+    "TotoIsSomewhere",
+];
+
+const EXPECTED = [
+    {
+        'in_args': [
+            { 'path': 'primitive', 'name': 'foo' },
+        ],
+    },
+    {
+        'returned': [
+            { 'path': 'primitive', 'name': 'foo' },
+        ],
+    },
+    {
+        'others': [],
+        'in_args': [],
+        'returned': [],
+    },
+];
diff --git a/src/test/rustdoc-js/primitive.rs b/src/test/rustdoc-js/primitive.rs
new file mode 100644
index 00000000000..2b30ccf1520
--- /dev/null
+++ b/src/test/rustdoc-js/primitive.rs
@@ -0,0 +1,5 @@
+pub fn foo(i: i32) -> &'static str {
+    "hello"
+}
+
+pub fn foo2<TotoIsSomewhere>(i: &TotoIsSomewhere, j: TotoIsSomewhere) {}