diff options
Diffstat (limited to 'chapter05/src/test/java/com/seaofnodes')
| -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;"); |
