From 4449d4af07106e68a41681d3fc7b18bbd06bd459 Mon Sep 17 00:00:00 2001 From: David Bar-On Date: Wed, 30 Dec 2020 10:34:44 +0200 Subject: [PATCH] Adding draft test cases for issue #4603 --- tests/source/issue-4603.rs | 47 ++++++++++++++++++++++++++++++++++++++ tests/target/issue-4603.rs | 0 2 files changed, 47 insertions(+) create mode 100644 tests/source/issue-4603.rs create mode 100644 tests/target/issue-4603.rs diff --git a/tests/source/issue-4603.rs b/tests/source/issue-4603.rs new file mode 100644 index 00000000000..ba0803e0eca --- /dev/null +++ b/tests/source/issue-4603.rs @@ -0,0 +1,47 @@ +// Formatting when original macro snippet is used + +// Original issue #4603 code +#![feature(or_patterns)] +macro_rules! t_or_f { + () => { + (true // some comment + | false) + }; +} + +// Other test cases variations +macro_rules! RULES { + () => { + ( + xxxxxxx // COMMENT + | yyyyyyy + ) + }; +} +macro_rules! RULES { + () => { + (xxxxxxx // COMMENT + | yyyyyyy) + }; +} + +fn main() { + macro_rules! RULES { + () => { + (xxxxxxx // COMMENT + | yyyyyyy) + }; + } +} + +macro_rules! RULES { + () => { + (xxxxxxx /* COMMENT */ | yyyyyyy) + }; +} +macro_rules! RULES { + () => { + (xxxxxxx /* COMMENT */ + | yyyyyyy) + }; +} diff --git a/tests/target/issue-4603.rs b/tests/target/issue-4603.rs new file mode 100644 index 00000000000..e69de29bb2d