Skip to content

Commit

Permalink
Add regression test for reexported macros docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 10, 2023
1 parent ddb31de commit 295fd0d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/rustdoc/reexport-macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Ensure that macros are correctly reexported and that they get both the comment from the
// `pub use` and from the macro.

#![crate_name = "foo"]

// @has 'foo/macro.foo.html'
// @!has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y'
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'y'
#[macro_use]
mod my_module {
/// y
#[macro_export]
macro_rules! foo {
() => ();
}
}

// @has 'foo/another_mod/macro.bar.html'
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y'
pub mod another_mod {
/// x
pub use crate::foo as bar;
}

0 comments on commit 295fd0d

Please sign in to comment.