From 50eb48e42b0be3dc124ad04eb14adfafabcaf155 Mon Sep 17 00:00:00 2001 From: Darren Tsung Date: Fri, 22 Dec 2017 10:37:44 -0800 Subject: [PATCH] Create failing test for equal inside macro --- tests/ui/eq_op.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/ui/eq_op.rs b/tests/ui/eq_op.rs index 89d85d1b3e9d..70c932a6cdf3 100644 --- a/tests/ui/eq_op.rs +++ b/tests/ui/eq_op.rs @@ -87,4 +87,20 @@ fn main() { let x = Y(1); let y = Y(2); let z = x & &y; + + check_ignore_macro(); +} + +macro_rules! check_if_named_foo { + ($expression:expr) => ( + if stringify!($expression) == "foo" { + println!("foo!"); + } else { + println!("not foo."); + } + ) +} + +fn check_ignore_macro() { + check_if_named_foo!(foo); }