From daf4789b768444035efef2383da75011237f4ef7 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Fri, 27 Oct 2017 16:35:40 +0900 Subject: [PATCH] Add a test for #2087 --- tests/source/macros.rs | 6 ++++++ tests/target/macros.rs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/tests/source/macros.rs b/tests/source/macros.rs index 616a275876fd..73044aa7ab2c 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -21,6 +21,12 @@ fn main() { kaas!(/* comments */ a /* post macro */, b /* another */); trailingcomma!( a , b , c , ); + // Preserve trailing comma only when necessary. + ok!(file.seek( + SeekFrom::Start( + table.map(|table| fixture.offset(table)).unwrap_or(0), + ) + )); noexpr!( i am not an expression, OK? ); diff --git a/tests/target/macros.rs b/tests/target/macros.rs index 394cac3820f3..a15dd14c9fb7 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -33,6 +33,10 @@ fn main() { ); trailingcomma!(a, b, c,); + // Preserve trailing comma only when necessary. + ok!(file.seek(SeekFrom::Start( + table.map(|table| fixture.offset(table)).unwrap_or(0), + ))); noexpr!( i am not an expression, OK? );