about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-17 09:11:17 +0100
committerGitHub <noreply@github.com>2025-01-17 09:11:17 +0100
commite2d14ec701089b313ce07cf7253663c76b81652f (patch)
treed67688ae54aa52014a0928744fc3a61343de88a2 /tests
parent0c2c096e1ac471b0c34629f9820a7cb1e6d4695d (diff)
parent9397d133f683070863029552313b5e083398bf42 (diff)
Rollup merge of #131806 - lolbinarycat:rustdoc-search-all-is-func, r=notriddle
Treat other items as functions for the purpose of type-based search

specifically, constants and statics are nullary functions, and struct fields are unary functions.

fixes #130204

r? ``@notriddle``
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc-gui/search-tab.goml2
-rw-r--r--tests/rustdoc-js-std/const-is-nullary-func.js7
-rw-r--r--tests/rustdoc-js-std/field-is-unary-func.js7
3 files changed, 15 insertions, 1 deletions
diff --git a/tests/rustdoc-gui/search-tab.goml b/tests/rustdoc-gui/search-tab.goml
index 3879c127fd0..eea561e0c67 100644
--- a/tests/rustdoc-gui/search-tab.goml
+++ b/tests/rustdoc-gui/search-tab.goml
@@ -79,7 +79,7 @@ set-window-size: (851, 600)
 
 // Check the size and count in tabs
 assert-text: ("#search-tabs > button:nth-child(1) > .count", " (26) ")
-assert-text: ("#search-tabs > button:nth-child(2) > .count", " (6)  ")
+assert-text: ("#search-tabs > button:nth-child(2) > .count", " (7)  ")
 assert-text: ("#search-tabs > button:nth-child(3) > .count", " (0)  ")
 store-property: ("#search-tabs > button:nth-child(1)", {"offsetWidth": buttonWidth})
 assert-property: ("#search-tabs > button:nth-child(2)", {"offsetWidth": |buttonWidth|})
diff --git a/tests/rustdoc-js-std/const-is-nullary-func.js b/tests/rustdoc-js-std/const-is-nullary-func.js
new file mode 100644
index 00000000000..e929741b038
--- /dev/null
+++ b/tests/rustdoc-js-std/const-is-nullary-func.js
@@ -0,0 +1,7 @@
+const EXPECTED = {
+    'query': '-> char',
+    'others': [
+        { 'path': 'std::char', 'name': 'from_digit' },
+        { 'path': 'std::char', 'name': 'MAX' },
+    ],
+}
diff --git a/tests/rustdoc-js-std/field-is-unary-func.js b/tests/rustdoc-js-std/field-is-unary-func.js
new file mode 100644
index 00000000000..09ce8a0dde0
--- /dev/null
+++ b/tests/rustdoc-js-std/field-is-unary-func.js
@@ -0,0 +1,7 @@
+const EXPECTED = {
+    // one of the only non-generic structs with public fields
+    'query': 'CpuidResult -> u32',
+    'others': [
+        { 'path': 'core::arch::x86::CpuidResult', 'name': 'eax' },
+    ],
+}