Skip to content

Commit 5a8d1dc

Browse files
committed
chore(parser): add inc/dec division test
1 parent beca5f1 commit 5a8d1dc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

parser/src/tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ fn test_parser_inc_dec() {
346346
{ --a[2] ++$(1 + 1) }
347347
{ a++ a["x"]-- }
348348
{ --a $"a"++ }
349+
{ --a/a++ a++/--a }
349350
"#;
350351
test_parser!(source => {
351352
rules: [
@@ -358,6 +359,8 @@ fn test_parser_inc_dec() {
358359
),
359360
(None, Some("(body (Concat (IncrementR awk::a) (DecrementR (Index awk::a \"x\"))))")),
360361
(None, Some("(body (Concat (DecrementL awk::a) (IncrementR (Record \"a\"))))")),
362+
(None, Some("(body (Concat (Divide (DecrementL awk::a) (IncrementR awk::a)) \
363+
(Divide (IncrementR awk::a) (DecrementL awk::a))))"))
361364
],
362365
});
363366
// these should parse as (Cat (--L (++R $0)) a), or otherwise error out.

0 commit comments

Comments
 (0)