summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/Chapter01Test.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-10-08 16:52:27 -0700
commitd32f97238c903765dec4e9a9f3cbfa5fd12cded6 (patch)
treea5ac731801ef7066bab6359c4e85c2bdd20082a6 /src/test/java/com/seaofnodes/simple/Chapter01Test.java
parentb5ebb2032aa04cf4506d533127d373d4cf5a25c6 (diff)
downloadSimple-linear.tar.gz
Simple-linear.zip
Chapter 25: Modules, Separate Compilation, and SSA Constructionlinear
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 <jun784@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter01Test.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/Chapter01Test.java10
1 files changed, 5 insertions, 5 deletions
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());
}
}