From f96a40f4db06b81bd7eb9bde965e8835d06a0447 Mon Sep 17 00:00:00 2001 From: Loïc BRANSTETT Date: Thu, 14 Oct 2021 02:12:18 +0200 Subject: Add regression test for #89852 --- src/test/rustdoc-json/reexport/macro.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/rustdoc-json/reexport/macro.rs (limited to 'src/test') diff --git a/src/test/rustdoc-json/reexport/macro.rs b/src/test/rustdoc-json/reexport/macro.rs new file mode 100644 index 00000000000..b86614ffbad --- /dev/null +++ b/src/test/rustdoc-json/reexport/macro.rs @@ -0,0 +1,17 @@ +// edition:2018 + +#![no_core] +#![feature(no_core)] + +// @count macro.json "$.index[*][?(@.name=='macro')].inner.items[*]" 2 + +// @set repro_id = macro.json "$.index[*][?(@.name=='repro')].id" +// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro_id +#[macro_export] +macro_rules! repro { + () => {}; +} + +// @set repro2_id = macro.json "$.index[*][?(@.inner.name=='repro2')].id" +// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro2_id +pub use crate::repro as repro2; -- cgit 1.4.1-3-g733a5 From 6307ecb63aedfd4d3bfc93d31b21cf6a7cd6cb84 Mon Sep 17 00:00:00 2001 From: Loïc BRANSTETT Date: Fri, 15 Oct 2021 12:56:47 +0200 Subject: Add equivalent test in src/test/rustdoc --- src/test/rustdoc/issue-89852.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/rustdoc/issue-89852.rs (limited to 'src/test') diff --git a/src/test/rustdoc/issue-89852.rs b/src/test/rustdoc/issue-89852.rs new file mode 100644 index 00000000000..dff2d07ac25 --- /dev/null +++ b/src/test/rustdoc/issue-89852.rs @@ -0,0 +1,14 @@ +// edition:2018 + +#![no_core] +#![feature(no_core)] + +// @count issue_89852/index.html '//*[@class="macro"]' 2 +// @has - '//*[@class="macro"]/@href' 'macro.repro.html' +#[macro_export] +macro_rules! repro { + () => {}; +} + +// @!has issue_89852/macro.repro.html '//*[@class="macro"]/@content' 'repro2' +pub use crate::repro as repro2; -- cgit 1.4.1-3-g733a5 From 7b9189aef301bd0e6cb2ec50835d3ce15eee051f Mon Sep 17 00:00:00 2001 From: Loïc BRANSTETT Date: Fri, 15 Oct 2021 16:54:31 +0200 Subject: Rework the equivalent test to work with sidebar-items.js --- src/test/rustdoc/issue-89852.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/rustdoc/issue-89852.rs b/src/test/rustdoc/issue-89852.rs index dff2d07ac25..45544dbeea6 100644 --- a/src/test/rustdoc/issue-89852.rs +++ b/src/test/rustdoc/issue-89852.rs @@ -3,12 +3,12 @@ #![no_core] #![feature(no_core)] -// @count issue_89852/index.html '//*[@class="macro"]' 2 -// @has - '//*[@class="macro"]/@href' 'macro.repro.html' +// @matches 'issue_89852/sidebar-items.js' '"repro"' +// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"' + #[macro_export] macro_rules! repro { () => {}; } -// @!has issue_89852/macro.repro.html '//*[@class="macro"]/@content' 'repro2' pub use crate::repro as repro2; -- cgit 1.4.1-3-g733a5