diff options
| author | Cliff Click <cliffc@acm.org> | 2023-10-29 10:04:09 -0700 |
|---|---|---|
| committer | Dibyendu Majumdar <dibyendumajumdar@users.noreply.github.com> | 2023-11-01 18:56:50 +0000 |
| commit | 6cb3c96d60f93fe52ced758b2e268b75a6ce3c48 (patch) | |
| tree | 27f4def14d83a3b030ad92aace3d002d24870c54 /chapter05/src/test | |
| parent | 4a425c35b81b144006907361fe55f2b3390e5d7c (diff) | |
| download | Simple-6cb3c96d60f93fe52ced758b2e268b75a6ce3c48.tar.gz Simple-6cb3c96d60f93fe52ced758b2e268b75a6ce3c48.zip | |
Fix missing trailing expression
Diffstat (limited to 'chapter05/src/test')
| -rw-r--r-- | chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java index 2ad7e59a..bb95dc18 100644 --- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -97,6 +97,16 @@ return c; } @Test + public void testChapter5BadNum() { + try { + new Parser("return 1-;").parse(); + fail(); + } catch( RuntimeException e ) { + assertEquals("Syntax error, expected an identifier or expression: ;",e.getMessage()); + } + } + + @Test public void testChapter5Keyword1() { try { new Parser("int true=0; return true;").parse(); |
