From d20eea073eff348cbc38c03c45305cf21e428f69 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 25 Apr 2020 17:37:34 +0800 Subject: Special case for empty comments --- crates/ra_mbe/src/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/ra_mbe/src') diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 100ed41f2..364dcc3c3 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs @@ -1849,3 +1849,16 @@ fn test_expand_bad_literal() { ) .assert_expand_err(r#"foo!(&k");"#, &ExpandError::BindingError("".into())); } + +#[test] +fn test_empty_comments() { + parse_macro( + r#" + macro_rules! one_arg_macro { ($fmt:expr) => (); } + "#, + ) + .assert_expand_err( + r#"one_arg_macro!(/**/)"#, + &ExpandError::BindingError("expected Expr".into()), + ); +} -- cgit v1.2.3 From f0fece4be07e338bbccb212ed06a7345b8d04a40 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 25 Apr 2020 18:49:46 +0800 Subject: Fix whitespaces --- crates/ra_mbe/src/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_mbe/src') diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 364dcc3c3..76f571502 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs @@ -1854,7 +1854,7 @@ fn test_expand_bad_literal() { fn test_empty_comments() { parse_macro( r#" - macro_rules! one_arg_macro { ($fmt:expr) => (); } + macro_rules! one_arg_macro { ($fmt:expr) => (); } "#, ) .assert_expand_err( -- cgit v1.2.3