From 0909ecbac7680a6fb235eda5f4a63f8816ee1357 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Sun, 10 Dec 2017 00:21:49 +0900 Subject: [PATCH] Add tests for macro in pattern position --- tests/source/macros.rs | 16 ++++++++++++++++ tests/target/macros.rs | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/source/macros.rs b/tests/source/macros.rs index 8c57ff4a4dd..db3c04f0d9b 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -284,3 +284,19 @@ impl Foo { /// foo pub fn foo(&self) -> Bar {} } + +// #819 +fn macro_in_pattern_position () { + let x = match y { + foo!( ) => (), + bar!( a, b, + c) => (), + bar!(a + , b + , c + ,) => (), + baz!( 1 + 2 + 3, quux.kaas( ) + ) => (), + quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) => (), + }; +} diff --git a/tests/target/macros.rs b/tests/target/macros.rs index 22b0286c766..6897d4c8796 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -808,3 +808,17 @@ impl Foo { /// foo pub fn foo(&self) -> Bar {} } + +// #819 +fn macro_in_pattern_position() { + let x = match y { + foo!() => (), + bar!(a, b, c) => (), + bar!(a, b, c,) => (), + baz!(1 + 2 + 3, quux.kaas()) => (), + quux!( + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, + BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB + ) => (), + }; +}