diff options
| author | Cliff Click <cliffc@acm.org> | 2023-10-29 09:52:59 -0700 |
|---|---|---|
| committer | Dibyendu Majumdar <dibyendumajumdar@users.noreply.github.com> | 2023-11-01 18:56:50 +0000 |
| commit | 4a425c35b81b144006907361fe55f2b3390e5d7c (patch) | |
| tree | d754c545633e78d72948e76dffcf286247bee7ae /chapter05/src/test/java | |
| parent | ccd83187b172f8ba3cd7c49b59a080fb027a184b (diff) | |
| download | Simple-4a425c35b81b144006907361fe55f2b3390e5d7c.tar.gz Simple-4a425c35b81b144006907361fe55f2b3390e5d7c.zip | |
Fix broken error report
Diffstat (limited to 'chapter05/src/test/java')
| -rw-r--r-- | chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java index 32ac5aac..2ad7e59a 100644 --- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -115,7 +115,16 @@ return c; assertEquals("Expected an identifier, found 'else'",e.getMessage()); } } - + + @Test + public void testChapter5Keyword3() { + try { + new Parser("int a=1; ififif(arg)inta=2;return a;").parse(); + fail(); + } catch( RuntimeException e ) { + assertEquals("Syntax error, expected =: (",e.getMessage()); + } + } @Test public void testChapter4Peephole() { Parser parser = new Parser("return 1+arg+2; #showGraph;"); |
