From d32f97238c903765dec4e9a9f3cbfa5fd12cded6 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 10 Aug 2026 11:11:18 -0700 Subject: Chapter 25: Modules, Separate Compilation, and SSA Construction Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki Co-authored-by: Claude Opus 5 --- src/test/java/com/seaofnodes/simple/Chapter01Test.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test/java/com/seaofnodes/simple/Chapter01Test.java') diff --git a/src/test/java/com/seaofnodes/simple/Chapter01Test.java b/src/test/java/com/seaofnodes/simple/Chapter01Test.java index ac9adacc..fa7fb68a 100644 --- a/src/test/java/com/seaofnodes/simple/Chapter01Test.java +++ b/src/test/java/com/seaofnodes/simple/Chapter01Test.java @@ -11,7 +11,7 @@ public class Chapter01Test { @Test public void testSimpleProgram() { - CodeGen code = new CodeGen("return 1;").parse(); + CodeGen code = new CodeGen("1;").parse(); Node expr = code.expr(); if( expr instanceof ConstantNode con ) { assertEquals(code._start,con.in(0)); @@ -53,7 +53,7 @@ public class Chapter01Test { @Test public void testNotBad3() { // this test used to fail in chapter 1 - assertEquals("return 12;", new CodeGen("return - -12;").parse()._stop.print()); + assertEquals("return 12;", new CodeGen("return - -12;").parse().print()); } @Test @@ -62,14 +62,14 @@ public class Chapter01Test { new CodeGen("return 100").parse(); fail(); } catch( RuntimeException e ) { - assertEquals("Syntax error, expected ;: ",e.getMessage()); + assertEquals("Syntax error, expected `;` but found `EOF`",e.getMessage()); } } @Test public void testNotBad5() { // this test used to fail in chapter 1 - assertEquals("return -100;", new CodeGen("return -100;").parse()._stop.print()); + assertEquals("return -100;", new CodeGen("return -100;").parse().print()); } @Test @@ -88,7 +88,7 @@ public class Chapter01Test { new CodeGen("return 1;}").parse(); fail(); } catch( RuntimeException e ) { - assertEquals("Syntax error, unexpected: }",e.getMessage()); + assertEquals("Syntax error, unexpected but found `}`",e.getMessage()); } } -- cgit v1.2.3