about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-10-30 19:31:39 -0700
committerGitHub <noreply@github.com>2022-10-30 19:31:39 -0700
commit4473fcd6f2dcb91d8df98dbfc314834bbbf90ad7 (patch)
tree173346977e589b82e5ef4edc9f82ff937dde4cda /src
parentc61a32aff24653868c903f86c4e152ab39c220ac (diff)
parenteb2dd95041a3a4241b9ebb218faa99afeaf81799 (diff)
downloadrust-4473fcd6f2dcb91d8df98dbfc314834bbbf90ad7.tar.gz
rust-4473fcd6f2dcb91d8df98dbfc314834bbbf90ad7.zip
Rollup merge of #103758 - GuillaumeGomez:reexports-search-result-test, r=notriddle
Add regression test for reexports in search results

Fixes https://github.com/rust-lang/rust/issues/86337.

r? ``@notriddle``
Diffstat (limited to 'src')
-rw-r--r--src/test/rustdoc-js/reexport.js17
-rw-r--r--src/test/rustdoc-js/reexport.rs11
2 files changed, 28 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/reexport.js b/src/test/rustdoc-js/reexport.js
new file mode 100644
index 00000000000..871e75d9b2b
--- /dev/null
+++ b/src/test/rustdoc-js/reexport.js
@@ -0,0 +1,17 @@
+// exact-check
+
+const QUERY = ['Subscriber', 'AnotherOne'];
+
+const EXPECTED = [
+    {
+        'others': [
+            { 'path': 'reexport::fmt', 'name': 'Subscriber' },
+            { 'path': 'reexport', 'name': 'FmtSubscriber' },
+        ],
+    },
+    {
+        'others': [
+            { 'path': 'reexport', 'name': 'AnotherOne' },
+        ],
+    },
+];
diff --git a/src/test/rustdoc-js/reexport.rs b/src/test/rustdoc-js/reexport.rs
new file mode 100644
index 00000000000..d69b2901edd
--- /dev/null
+++ b/src/test/rustdoc-js/reexport.rs
@@ -0,0 +1,11 @@
+// This test enforces that the (renamed) reexports are present in the search results.
+
+pub mod fmt {
+    pub struct Subscriber;
+}
+mod foo {
+    pub struct AnotherOne;
+}
+
+pub use foo::AnotherOne;
+pub use fmt::Subscriber as FmtSubscriber;