From 2aa8c5d1d0659bd1c828134f1a1f14d025a2d0f1 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 7 Feb 2025 08:58:36 -0800 Subject: Ch# Chapter 19: Instruction Selection and Portable Compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: hadha Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> --- src/test/java/com/seaofnodes/simple/Chapter03Test.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/java/com/seaofnodes/simple/Chapter03Test.java') diff --git a/src/test/java/com/seaofnodes/simple/Chapter03Test.java b/src/test/java/com/seaofnodes/simple/Chapter03Test.java index 825235cc..4f9b2490 100644 --- a/src/test/java/com/seaofnodes/simple/Chapter03Test.java +++ b/src/test/java/com/seaofnodes/simple/Chapter03Test.java @@ -29,8 +29,8 @@ public class Chapter03Test { @Test public void testVarScopeNoPeephole() { CodeGen code = new CodeGen("int a=1; int b=2; int !c=0; { int b=3; c=a+b; } return c; "); - code.parse(true); - assertEquals("return (1+3);", code.print()); + code.parse(); // Peepholes always run now + assertEquals("return 4;", code.print()); } @Test @@ -53,7 +53,7 @@ public class Chapter03Test { @Test public void testRedeclareVar() { try { - new Parser("int a=1; int b=2; int c=0; int b=3; c=a+b;").parse(); + new CodeGen("int a=1; int b=2; int c=0; int b=3; c=a+b;").parse(); fail(); } catch( RuntimeException e ) { assertEquals("Redefining name 'b'",e.getMessage()); -- cgit v1.2.3