about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-10-30 13:58:00 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-10-30 13:58:00 +0100
commiteb2dd95041a3a4241b9ebb218faa99afeaf81799 (patch)
tree6effb2e730e801c5f2b8a15a19894c9957c99f02
parente96c330af5e3baebe7a80999744e2e082b279d0a (diff)
downloadrust-eb2dd95041a3a4241b9ebb218faa99afeaf81799.tar.gz
rust-eb2dd95041a3a4241b9ebb218faa99afeaf81799.zip
Add regression test for reexports in search results
-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;