From 06fb5aceeb65a75b1cd643debd667c52fdcafcb9 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 8 Nov 2026 14:10:02 -0800 Subject: Better error messages Better error messages. Buffs to the std lib; getch() to fetch a single character; streaming I/O handles retries, and large sizes, with better error reporting. Formatted strings. Default int moved to i32. TicTacToe, the game. --- .../test/java/com/seaofnodes/simple/FinalConstructionTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'chapter30/src/test/java/com/seaofnodes/simple/FinalConstructionTest.java') diff --git a/chapter30/src/test/java/com/seaofnodes/simple/FinalConstructionTest.java b/chapter30/src/test/java/com/seaofnodes/simple/FinalConstructionTest.java index 66fdacc3..bdb71fc6 100644 --- a/chapter30/src/test/java/com/seaofnodes/simple/FinalConstructionTest.java +++ b/chapter30/src/test/java/com/seaofnodes/simple/FinalConstructionTest.java @@ -7,7 +7,7 @@ import static org.junit.Assert.*; public class FinalConstructionTest { private static final String LOOP = """ - val step={int x -> x*2+1;}; + val step={i64 x -> x*2+1;}; struct C { val x=1; new C={int n -> @@ -16,7 +16,7 @@ public class FinalConstructionTest { }; val get={->x;}; }; - return new C(arg).get(); + return new C(((arg<<32)>>32)).get(); """; @Test public void testFinalConstructorFields() throws java.io.IOException { @@ -27,10 +27,10 @@ public class FinalConstructionTest { // Writes are ordinary Stores and may remain inside the loop. String[] sources={ "struct C { val x=1; new C={->x=1; x=2;}; }; return new C().x;", - "struct C { int ~x; new C={int n -> self.x=1; for(int i=0;i for(int i=0;i self.x=1; for(int i=0;i>32)).x;", + "struct C { val x=1; new C={int n -> for(int i=0;i>32)).x;", "struct C { val x=1.5; new C={->x=2.5;}; }; return new C().x;", - "struct C { val x=\"a\"; new C={int n -> for(int i=0;i for(int i=0;i>32)).x[0];", "struct C { val x=new int[1]; new C={->x=new int[2]; x=new int[3];}; }; return new C().x#;" }; String[] results={"2","8","4","2.5","98","3"}; -- cgit v1.2.3