summaryrefslogtreecommitdiff
path: root/chapter10b/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'chapter10b/src/test/java')
-rw-r--r--chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
index aefb3a5c..cf7bd6cf 100644
--- a/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
+++ b/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
@@ -134,6 +134,21 @@ return a;""");
}
@Test
+ public void testMergeSameCon() {
+ Parser parser = new Parser(
+"""
+int a=arg;
+if( arg==1 )
+ a=3;
+else
+ a=3;
+return a;
+""");
+ StopNode ret = parser.parse();
+ assertEquals("return 3;", ret.toString());
+ }
+
+ @Test
public void testTrue() {
StopNode stop = new Parser("return true;").parse();
assertEquals("return 1;",stop.toString());