summaryrefslogtreecommitdiff
path: root/chapter16/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'chapter16/src/test/java')
-rw-r--r--chapter16/src/test/java/com/seaofnodes/simple/Chapter10Test.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/chapter16/src/test/java/com/seaofnodes/simple/Chapter10Test.java b/chapter16/src/test/java/com/seaofnodes/simple/Chapter10Test.java
index a31dfab3..2a33031d 100644
--- a/chapter16/src/test/java/com/seaofnodes/simple/Chapter10Test.java
+++ b/chapter16/src/test/java/com/seaofnodes/simple/Chapter10Test.java
@@ -1,5 +1,6 @@
package com.seaofnodes.simple;
+import com.seaofnodes.simple.evaluator.Evaluator;
import com.seaofnodes.simple.node.StopNode;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -285,15 +286,13 @@ return ret;
@Test
public void testBug3() {
Parser parser = new Parser("""
-struct s0 {
- int f0;
-};
-if(0>=0) return new s0;
+struct s0 { int f0; };
return new s0;
int v0=null.f0;
""");
- try { parser.parse(); fail(); }
- catch( Exception e ) { assertEquals("Accessing unknown field 'f0' from 'null'", e.getMessage()); }
+ StopNode stop = parser.parse().iterate();
+ assertEquals("return s0;", stop.toString());
+ assertEquals("Obj<s0>{f0=0}", Evaluator.evaluate(stop, 0).toString());
}
@Test