summaryrefslogtreecommitdiff
path: root/chapter25/src/test
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-10-02 11:39:55 -0700
committerCliff Click <cliffc@acm.org>2026-10-02 11:39:55 -0700
commit6cd01a8d646750748a0af221073de8a7787472ad (patch)
tree4d4159f74efe288f51ca97c78252a8f77d9c69a9 /chapter25/src/test
parentd5352268a0a1355262eed78e3263c18486fb9d8a (diff)
downloadSimple-6cd01a8d646750748a0af221073de8a7787472ad.tar.gz
Simple-6cd01a8d646750748a0af221073de8a7787472ad.zip
Fix some older tests
Diffstat (limited to 'chapter25/src/test')
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21AllocTest-testString.smp1
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21Test-testStringExport.smp1
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter23AllocTest-testString.smp1
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/spill/README.md7
4 files changed, 10 insertions, 0 deletions
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21AllocTest-testString.smp b/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21AllocTest-testString.smp
index dafa7456..86220b7a 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21AllocTest-testString.smp
+++ b/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21AllocTest-testString.smp
@@ -2,6 +2,7 @@
struct String {
u8[] cs;
int _hashCode;
+ new String = { u8[] data -> cs=data; };
};
// Compare two Strings
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21Test-testStringExport.smp b/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21Test-testStringExport.smp
index 6cc28315..3a696d66 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21Test-testStringExport.smp
+++ b/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter21Test-testStringExport.smp
@@ -1,6 +1,7 @@
struct String {
u8[] cs;
int _hashCode;
+ new String = { u8[] data -> cs=data; };
};
// Compare two Strings
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter23AllocTest-testString.smp b/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter23AllocTest-testString.smp
index 3fa2174c..1a4d55c1 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter23AllocTest-testString.smp
+++ b/chapter25/src/test/java/com/seaofnodes/simple/spill/Chapter23AllocTest-testString.smp
@@ -2,6 +2,7 @@
struct String {
u8[] cs;
int _hashCode;
+ new String = { u8[] data -> cs=data; };
};
// Compare two Strings
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/spill/README.md b/chapter25/src/test/java/com/seaofnodes/simple/spill/README.md
index 6c78d46f..57435402 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/spill/README.md
+++ b/chapter25/src/test/java/com/seaofnodes/simple/spill/README.md
@@ -17,6 +17,13 @@ Chapter 25 cannot parse all earlier sources unchanged. Adaptations are explicit:
- String, Scan, and linked S constructors replace `new S { field=...; }` with
declared constructors and arguments. The explicit-receiver scanner functions
become instance methods, preserving their operations.
+- The saved `Chapter21Test-testStringExport`, `Chapter21AllocTest-testString`,
+ and `Chapter23AllocTest-testString` sources declare
+ `new String = { u8[] data -> cs=data; };` to initialize the required non-null
+ `cs` field. This repairs ten replay entries (four, three, and three), without
+ changing their equality/hash bodies or manifest membership. These adapted
+ sources are a new comparison baseline; their totals cannot be compared as
+ identical inputs with the earlier constructor-free fixtures.
- The two short-circuit RHS initializer loops become equivalent guarded blocks,
preserving allocation, side effects, and the final result.
- Simple I/O cases include the old `write` binding and print helper directly.