summaryrefslogtreecommitdiff
path: root/chapter03/src/test
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-09-22 11:25:05 -0700
committerCliff Click <cliffc@acm.org>2026-09-22 11:25:05 -0700
commit29fb671e69f90ad3b04c6fa8d746caf857f89e77 (patch)
tree2f39d082f8a6de6a2b60b66406f8c9f0190d25c2 /chapter03/src/test
parent1d961838cff168a101069d08a8ab6594f49f0911 (diff)
downloadSimple-29fb671e69f90ad3b04c6fa8d746caf857f89e77.tar.gz
Simple-29fb671e69f90ad3b04c6fa8d746caf857f89e77.zip
Add shared graph viewer to all chapters
Diffstat (limited to 'chapter03/src/test')
-rw-r--r--chapter03/src/test/java/com/seaofnodes/simple/Chapter02Test.java4
-rw-r--r--chapter03/src/test/java/com/seaofnodes/simple/Chapter03Test.java4
2 files changed, 2 insertions, 6 deletions
diff --git a/chapter03/src/test/java/com/seaofnodes/simple/Chapter02Test.java b/chapter03/src/test/java/com/seaofnodes/simple/Chapter02Test.java
index 60ee8874..9de09d21 100644
--- a/chapter03/src/test/java/com/seaofnodes/simple/Chapter02Test.java
+++ b/chapter03/src/test/java/com/seaofnodes/simple/Chapter02Test.java
@@ -14,8 +14,6 @@ public class Chapter02Test {
Node._disablePeephole = true; // disable peephole so we can observe full graph
ReturnNode ret = parser.parse();
assertEquals("return (1+((2*3)+(-5)));", ret.print());
- GraphVisualizer gv = new GraphVisualizer();
- System.out.println(gv.generateDotOutput(parser));
Node._disablePeephole = false;
}
@@ -59,8 +57,6 @@ public class Chapter02Test {
Parser parser = new Parser("return 1+2*3+-5;");
ReturnNode ret = parser.parse();
assertEquals("return 2;", ret.print());
- GraphVisualizer gv = new GraphVisualizer();
- System.out.println(gv.generateDotOutput(parser));
}
}
diff --git a/chapter03/src/test/java/com/seaofnodes/simple/Chapter03Test.java b/chapter03/src/test/java/com/seaofnodes/simple/Chapter03Test.java
index 3b8b3449..b42f1433 100644
--- a/chapter03/src/test/java/com/seaofnodes/simple/Chapter03Test.java
+++ b/chapter03/src/test/java/com/seaofnodes/simple/Chapter03Test.java
@@ -30,7 +30,7 @@ public class Chapter03Test {
@Test
public void testVarScopeNoPeephole() {
- Parser parser = new Parser("int a=1; int b=2; int c=0; { int b=3; c=a+b; #showGraph; } return c; #showGraph;");
+ Parser parser = new Parser("int a=1; int b=2; int c=0; { int b=3; c=a+b; } return c; ");
Node._disablePeephole = true;
ReturnNode ret = parser.parse();
Node._disablePeephole = false;
@@ -39,7 +39,7 @@ public class Chapter03Test {
@Test
public void testVarDist() {
- Parser parser = new Parser("int x0=1; int y0=2; int x1=3; int y1=4; return (x0-x1)*(x0-x1) + (y0-y1)*(y0-y1); #showGraph;");
+ Parser parser = new Parser("int x0=1; int y0=2; int x1=3; int y1=4; return (x0-x1)*(x0-x1) + (y0-y1)*(y0-y1); ");
ReturnNode ret = parser.parse();
assertEquals("return 8;", ret.print());
}