From ba6a3280f52c2ad6a6bec5e8792ecd0ce2006062 Mon Sep 17 00:00:00 2001 From: pmk21 Date: Tue, 31 Mar 2020 15:49:27 +0530 Subject: [PATCH] Added test for single_match in macro --- tests/ui/single_match.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/ui/single_match.rs b/tests/ui/single_match.rs index 980ce9a0fabe..6766a6409b22 100644 --- a/tests/ui/single_match.rs +++ b/tests/ui/single_match.rs @@ -81,4 +81,13 @@ fn single_match_know_enum() { } } -fn main() {} +macro_rules! single_match { + ($num:literal) => { + match $num { + 15 => println!("15"), + _ => (), + } + }; +} + +fn main() {single_match!(5);}