From cf2dff2b1e3fa55fa5415d524200070d0d7aacfe Mon Sep 17 00:00:00 2001 From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:13:28 +0100 Subject: Move /src/test to /tests --- tests/rustdoc/macro_rules-matchers.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/rustdoc/macro_rules-matchers.rs (limited to 'tests/rustdoc/macro_rules-matchers.rs') diff --git a/tests/rustdoc/macro_rules-matchers.rs b/tests/rustdoc/macro_rules-matchers.rs new file mode 100644 index 00000000000..96f4126c7c2 --- /dev/null +++ b/tests/rustdoc/macro_rules-matchers.rs @@ -0,0 +1,34 @@ +// This is a regression test for issue #86208. +// It is also a general test of macro_rules! display. + +#![crate_name = "foo"] + +// @has 'foo/macro.todo.html' +// @has - '//span[@class="macro"]' 'macro_rules!' +// @hasraw - ' todo {' + +// @hasraw - '{ () => { ... }; ($(' +// @has - '//span[@class="macro-nonterminal"]' '$' +// @has - '//span[@class="macro-nonterminal"]' 'arg' +// @hasraw - ':tt)+' +// @hasraw - ') => { ... }; }' +pub use std::todo; + +mod mod1 { + // @has 'foo/macro.macro1.html' + // @hasraw - 'macro_rules!' + // @hasraw - 'macro1' + // @hasraw - '{ () => { ... }; ($(' + // @has - '//span[@class="macro-nonterminal"]' '$' + // @has - '//span[@class="macro-nonterminal"]' 'arg' + // @hasraw - ':' + // @hasraw - 'expr' + // @hasraw - '),' + // @hasraw - '+' + // @hasraw - ') => { ... }; }' + #[macro_export] + macro_rules! macro1 { + () => {}; + ($($arg:expr),+) => { stringify!($($arg),+) }; + } +} -- cgit 1.4.1-3-g733a5