Skip to content

Commit 56207f6

Browse files
committed
Add ExprKind::MacCall statement boundary tests
1 parent 0860cb1 commit 56207f6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/ui/macros/stringify.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,21 @@ fn test_expr() {
214214
"match () { _ => ({ 1 }) - 1, }",
215215
"match() { _ => { 1 } - 1 }",
216216
);
217+
c2_match_arm!(
218+
[ m!() - 1 ],
219+
"match () { _ => m!() - 1, }",
220+
"match() { _ => m!() - 1 }",
221+
);
222+
c2_match_arm!(
223+
[ m![] - 1 ],
224+
"match () { _ => m![] - 1, }",
225+
"match() { _ => m![] - 1 }",
226+
);
227+
c2_match_arm!(
228+
[ m! {} - 1 ],
229+
"match () { _ => m! {} - 1, }",
230+
"match() { _ => m! {} - 1 }",
231+
);
217232

218233
// ExprKind::Closure
219234
c1!(expr, [ || {} ], "|| {}");
@@ -721,6 +736,21 @@ fn test_stmt() {
721736
"(loop { break 1; }) - 1;",
722737
"loop { break 1; } - 1",
723738
);
739+
c2_minus_one!(
740+
[ m!() ],
741+
"m!() - 1;",
742+
"m!() - 1"
743+
);
744+
c2_minus_one!(
745+
[ m![] ],
746+
"m![] - 1;",
747+
"m![] - 1"
748+
);
749+
c2_minus_one!(
750+
[ m! {} ],
751+
"m! {} - 1;", // FIXME(dtolnay): needs parens, otherwise this is 2 separate statements
752+
"m! {} - 1"
753+
);
724754

725755
// StmtKind::Empty
726756
c1!(stmt, [ ; ], ";");

0 commit comments

Comments
 (0)