From caa2b978e5a0a83b2615e1e703ce1ec07bf86f77 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 30 Dec 2024 14:16:36 -0800 Subject: Test for "arg--2" Parse as "arg - -2" and not "arg-- 2" which is a syntax error --- chapter12/src/test/java/com/seaofnodes/simple/Chapter04Test.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'chapter12/src/test') diff --git a/chapter12/src/test/java/com/seaofnodes/simple/Chapter04Test.java b/chapter12/src/test/java/com/seaofnodes/simple/Chapter04Test.java index 70f38dd6..80cdb3f2 100644 --- a/chapter12/src/test/java/com/seaofnodes/simple/Chapter04Test.java +++ b/chapter12/src/test/java/com/seaofnodes/simple/Chapter04Test.java @@ -125,4 +125,10 @@ public class Chapter04Test { assertEquals("return (-arg);", ret.print()); } + @Test + public void testBug5() { + Parser parser = new Parser("return arg--2;"); + StopNode ret = parser.parse(); + assertEquals("return (arg--2);", ret.print()); + } } -- cgit v1.2.3