Skip to content

Commit 485e2df

Browse files
committed
Add regression test.
1 parent b40b7ef commit 485e2df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/run-pass/macro-of-higher-order.rs

+9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ macro_rules! higher_order {
1616
});
1717
}
1818

19+
macro_rules! outer {
20+
($x:expr; $fragment:ident) => {
21+
macro_rules! inner { ($y:$fragment) => { $x + $y } }
22+
}
23+
}
24+
1925
fn main() {
2026
let val = higher_order!(subst ($x:expr, $y:expr, $foo:expr) => (($x + $y, $foo)));
2127
assert_eq!(val, (3, "foo"));
28+
29+
outer!(2; expr);
30+
assert_eq!(inner!(3), 5);
2231
}

0 commit comments

Comments
 (0)