summaryrefslogtreecommitdiff
path: root/chapter12/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'chapter12/src/test/java')
-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