aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ssr/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ssr/src/tests.rs')
-rw-r--r--crates/ra_ssr/src/tests.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_ssr/src/tests.rs b/crates/ra_ssr/src/tests.rs
index 7a3141be8..8be60c293 100644
--- a/crates/ra_ssr/src/tests.rs
+++ b/crates/ra_ssr/src/tests.rs
@@ -606,3 +606,20 @@ fn replace_within_macro_expansion() {
606 fn f() {macro1!(bar(5.x()).o2())}"#, 606 fn f() {macro1!(bar(5.x()).o2())}"#,
607 ) 607 )
608} 608}
609
610#[test]
611fn preserves_whitespace_within_macro_expansion() {
612 assert_ssr_transform(
613 "$a + $b ==>> $b - $a",
614 r#"
615 macro_rules! macro1 {
616 ($a:expr) => {$a}
617 }
618 fn f() {macro1!(1 * 2 + 3 + 4}"#,
619 r#"
620 macro_rules! macro1 {
621 ($a:expr) => {$a}
622 }
623 fn f() {macro1!(4 - 3 - 1 * 2}"#,
624 )
625}