Skip to content

Commit

Permalink
Extended simple macro test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimundi committed Nov 26, 2015
1 parent 02a18a6 commit 49e9974
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/test/run-pass/stmt_expr_attr_macro_parse.rs
Expand Up @@ -17,6 +17,16 @@ macro_rules! m {
}
}

macro_rules! n {
(#[$attr:meta] $e:expr) => {
"expr excludes attr"
};
($e:expr) => {
"expr includes attr"
}
}

fn main() {
assert_eq!(m!(#[attr] 1 + 1), "expr includes attr");
assert_eq!(m!(#[attr] 1), "expr includes attr");
assert_eq!(n!(#[attr] 1), "expr excludes attr");
}

0 comments on commit 49e9974

Please sign in to comment.