diff options
| author | Cliff Click <cliffc@acm.org> | 2026-09-27 08:52:12 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-09-27 08:52:12 -0700 |
| commit | c5ef4e52fd7d183861b33476db999fa04f777607 (patch) | |
| tree | fae4a9fb155a2e60b4b4390cd0ad3d30851257c8 /chapter06/src/test/java/com/seaofnodes | |
| parent | 4391fcc03a214e6296e19ca42487de023ab12f6a (diff) | |
| download | Simple-c5ef4e52fd7d183861b33476db999fa04f777607.tar.gz Simple-c5ef4e52fd7d183861b33476db999fa04f777607.zip | |
Remove -disablePeephole
Diffstat (limited to 'chapter06/src/test/java/com/seaofnodes')
| -rw-r--r-- | chapter06/src/test/java/com/seaofnodes/simple/Chapter02Test.java | 4 | ||||
| -rw-r--r-- | chapter06/src/test/java/com/seaofnodes/simple/Chapter03Test.java | 9 |
2 files changed, 1 insertions, 12 deletions
diff --git a/chapter06/src/test/java/com/seaofnodes/simple/Chapter02Test.java b/chapter06/src/test/java/com/seaofnodes/simple/Chapter02Test.java index 47cee096..a6075b75 100644 --- a/chapter06/src/test/java/com/seaofnodes/simple/Chapter02Test.java +++ b/chapter06/src/test/java/com/seaofnodes/simple/Chapter02Test.java @@ -11,10 +11,8 @@ public class Chapter02Test { @Test public void testParseGrammar() { Parser parser = new Parser("return 1+2*3+-5;"); - Node._disablePeephole = true; // disable peephole so we can observe full graph StopNode ret = parser.parse(); - assertEquals("return (1+((2*3)+(-5)));", ret.print()); - Node._disablePeephole = false; + assertEquals("return 2;", ret.print()); } @Test diff --git a/chapter06/src/test/java/com/seaofnodes/simple/Chapter03Test.java b/chapter06/src/test/java/com/seaofnodes/simple/Chapter03Test.java index 10b67f5f..c3cd43c3 100644 --- a/chapter06/src/test/java/com/seaofnodes/simple/Chapter03Test.java +++ b/chapter06/src/test/java/com/seaofnodes/simple/Chapter03Test.java @@ -30,15 +30,6 @@ 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; } return c;"); - Node._disablePeephole = true; - StopNode ret = parser.parse(); - Node._disablePeephole = false; - assertEquals("return (1+3);", ret.print()); - } - - @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);"); StopNode ret = parser.parse(); |
