Add regression test.
This commit is contained in:
parent
b40b7ef0c4
commit
485e2df1b1
@ -16,7 +16,16 @@ macro_rules! higher_order {
|
||||
});
|
||||
}
|
||||
|
||||
macro_rules! outer {
|
||||
($x:expr; $fragment:ident) => {
|
||||
macro_rules! inner { ($y:$fragment) => { $x + $y } }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let val = higher_order!(subst ($x:expr, $y:expr, $foo:expr) => (($x + $y, $foo)));
|
||||
assert_eq!(val, (3, "foo"));
|
||||
|
||||
outer!(2; expr);
|
||||
assert_eq!(inner!(3), 5);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user