Skip to content

Commit

Permalink
Add macro_rules tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser committed Feb 4, 2018
1 parent 5d973d2 commit c750442
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/source/macro_rules.rs
@@ -0,0 +1,16 @@
macro_rules! m {
($expr :expr, $func : ident) => {
{
let x = $expr;
$func (
x
)
}
};

() => { };

( $item:ident ) => {
mod macro_item { struct $item ; }
};
}
17 changes: 17 additions & 0 deletions tests/target/macro_rules.rs
@@ -0,0 +1,17 @@
macro_rules! m {
($expr: expr, $func: ident) => {
{
let x = $expr;
$func(x)
}
};

() => {
};

($item: ident) => {
mod macro_item {
struct $item;
}
};
}

0 comments on commit c750442

Please sign in to comment.