From 5aaa00a92963f484b591a1d28b49e5decf7bb150 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Thu, 30 Nov 2017 22:12:55 +0900 Subject: [PATCH] Add a test for #2214 --- tests/source/macros.rs | 12 ++++++++++++ tests/target/macros.rs | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/tests/source/macros.rs b/tests/source/macros.rs index 73044aa7ab2c..c8f769062542 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -204,3 +204,15 @@ macro_rules! try_opt { None => { return None; } }) } + +// #2214 +// macro call whose argument is an array with trailing comma. +fn issue2214() { +make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [ + Reject(0, 1), + Match (1, 3), + Reject(3, 4), + Match (4, 6), + Reject(6, 7), +]); +} diff --git a/tests/target/macros.rs b/tests/target/macros.rs index a15dd14c9fb7..25156ff21fda 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -253,3 +253,20 @@ macro_rules! try_opt { None => { return None; } }) } + +// #2214 +// macro call whose argument is an array with trailing comma. +fn issue2214() { + make_test!( + str_searcher_ascii_haystack, + "bb", + "abbcbbd", + [ + Reject(0, 1), + Match(1, 3), + Reject(3, 4), + Match(4, 6), + Reject(6, 7), + ] + ); +}