summaryrefslogtreecommitdiff
path: root/chapter12/src/test/java/com/seaofnodes
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2024-07-26 11:46:59 +0300
committerDibyendu Majumdar <dibyendumajumdar@users.noreply.github.com>2024-08-05 23:28:33 +0100
commitf985590bee537977952dd3017fc6cb16f014161b (patch)
tree35f47daf174077a1b1d3bd04940e860fcacb403d /chapter12/src/test/java/com/seaofnodes
parent799ba3a8d2603a51fc5b860f7845e72e6af61c38 (diff)
downloadSimple-f985590bee537977952dd3017fc6cb16f014161b.tar.gz
Simple-f985590bee537977952dd3017fc6cb16f014161b.zip
Better filter on Load clone
Diffstat (limited to 'chapter12/src/test/java/com/seaofnodes')
-rw-r--r--chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java b/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java
index af8fdfe9..2eeccba9 100644
--- a/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java
+++ b/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java
@@ -13,11 +13,21 @@ public class Chapter12Test {
public void testJig() {
Parser parser = new Parser(
"""
-return 3.14;
+struct s0 {
+ int v0;
+}
+s0? fIflMOdp;
+while(1) {
+ if(fIflMOdp){
+ fIflMOdp.v0=-fIflMOdp.v0;
+ continue;
+ }
+ break;
+}
""");
StopNode stop = parser.parse(false).iterate(false);
- assertEquals("return 3.14;", stop.toString());
- assertEquals(3.14, Evaluator.evaluate(stop, 0));
+ assertEquals("return 0;", stop.toString());
+ assertEquals(0L, Evaluator.evaluate(stop, 0));
}
@Test