diff options
| author | Cliff Click <cliffc@acm.org> | 2025-05-06 13:44:10 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-07-08 20:29:09 -0700 |
| commit | 664761624f4b0e3d6d1593b99e576854beec5949 (patch) | |
| tree | edff0e36e07cdc5aa82c8f7d144d68c52d5a4365 /src/test/java/com/seaofnodes/simple/Chapter10Test.java | |
| parent | 018379b0cf4e286ceacb1e39f34dd80f770e381e (diff) | |
| download | Simple-linear-chapter23.tar.gz Simple-linear-chapter23.zip | |
Chapter 23: Methods and Revisiting Typeslinear-chapter23
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter10Test.java')
| -rw-r--r-- | src/test/java/com/seaofnodes/simple/Chapter10Test.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter10Test.java b/src/test/java/com/seaofnodes/simple/Chapter10Test.java index 712704db..ec363239 100644 --- a/src/test/java/com/seaofnodes/simple/Chapter10Test.java +++ b/src/test/java/com/seaofnodes/simple/Chapter10Test.java @@ -115,7 +115,7 @@ if (arg) bar = null; bar.a = 1; return bar.a; """); - try { code.parse().opto(); fail(); } + try { code.parse().opto().typeCheck(); fail(); } catch( Exception e ) { assertEquals("Type null is not of declared type *Bar",e.getMessage()); } } @@ -141,7 +141,7 @@ if (arg) bar = null; bar.a = 1; return bar.a; """); - try { code.parse(); fail(); } + try { code.parse().opto().typeCheck(); fail(); } catch( Exception e ) { assertEquals("Type null is not of declared type *Bar", e.getMessage()); } } @@ -290,7 +290,7 @@ return new s0; int v0=null.f0; """); try { code.parse(); fail(); } - catch( Exception e ) { assertEquals("Accessing unknown field 'f0' from 'null'",e.getMessage()); } + catch( Exception e ) { assertEquals("Syntax error, expected ;: .",e.getMessage()); } } @Test @@ -349,7 +349,7 @@ s0 v1 = v0; return v1; """); code.parse().opto(); - assertEquals("return (const)s0;", code.print()); + assertEquals("return s0;", code.print()); } |
