Skip to content

Commit d950c1b

Browse files
committed
Extend rustdoc macro-generated-macro test
1 parent 9ad5d82 commit d950c1b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
macro_rules! outer {
2-
($($matcher:tt)*) => {
1+
macro_rules! make_macro {
2+
($macro_name:ident $($matcher:tt)*) => {
33
#[macro_export]
4-
macro_rules! inner {
4+
macro_rules! $macro_name {
55
(<= $($matcher)* =>) => {};
66
}
77
}
88
}
99

10-
// @has macro_generated_macro/macro.inner.html //pre 'macro_rules! inner {'
10+
// @has macro_generated_macro/macro.interpolations.html //pre 'macro_rules! interpolations {'
1111
// @has - //pre '(<= type $($i : ident) :: * + $e : expr =>) => { ... };'
12-
outer!(type $($i:ident)::* + $e:expr);
12+
make_macro!(interpolations type $($i:ident)::* + $e:expr);
13+
interpolations!(<= type foo::bar + x.sort() =>);
1314

14-
inner!(<= type foo::bar + x.sort() =>);
15+
// @has macro_generated_macro/macro.attributes.html //pre 'macro_rules! attributes {'
16+
// @has - //pre '(<= #! [no_std] #[inline] =>) => { ... };'
17+
make_macro!(attributes #![no_std] #[inline]);
18+
19+
// @has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {'
20+
// @has - //pre '(<= fn {} () { foo [0] } =>) => { ... };'
21+
make_macro!(groups fn {}() {foo[0]});

0 commit comments

Comments
 (0)