Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .trinity/seals/claw_ClawText.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"built_by": "t27c-bootstrap@0.5.2+4ab200073",
"built_by": "t27c-bootstrap@0.5.2+9448ab4be",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:91762b4b1d04fca688d249cd452eace91ca586e70aee0551c770f84b5da67300",
"gen_hash_rust": "sha256:3c2ab4d541e80a7b7ecb335a3bce0ebaac46c1e0e64c67c39468509c98aa9da4",
"gen_hash_verilog": "sha256:bad1d4ab44c3cb0be36ce57227762d216b5aa30538d9a9457cfe10b731fdd7d4",
"gen_hash_zig": "sha256:d208b808b576f1dbe7b7cc721653deaf2ddcc605a9ef0b82970c19e000f7d0c6",
"gen_hash_c": "sha256:b59cbd98a2c2f3973ce97cf39abc9b992a590055a34394a0547a8d0a7ff76758",
"gen_hash_rust": "sha256:7c1f327640c4418baa19d847e23ec9d3ac96707b3d8a5ccea0b8f9d860af3492",
"gen_hash_verilog": "sha256:1166cfb46959e156cc1d9a03b4994fef8cb7b5b8071528c1793642867a3d3e68",
"gen_hash_zig": "sha256:98adafb0eac8bba62c82365c19d1f9d6a718c327917bfc2da761b2a02b7b433b",
"module": "ClawText",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-18T09:41:18Z",
"sealed_at": "2026-10-18T23:12:27Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:b65da69dff231c61a6d3a48558af9e17af42e1acbe3f4763348f1f0c2f118f21",
"spec_hash": "sha256:968755ec1917f766eb2cdd0ab4c0c48aef028a0e7d69e191911695e925b286ad",
"spec_path": "specs/claw/text.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 7,
"total": 7,
"passed": 9,
"total": 9,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
"test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10",
"zig": "0.16.0"
}
}
21 changes: 21 additions & 0 deletions specs/claw/text.t27
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,24 @@ test has_prefix_matches_and_rejects {
assert has_prefix("", 0, "claw-v", 6) == false;
assert has_prefix("anything", 8, "", 0) == true;
}

test has_prefix_rejects_a_mismatch_that_fits {
// Every reject above is a string shorter than the prefix, so the byte loop's reject was never
// reached: a loop that answered true on a mismatch passed (mutation sweep, #10713). These
// fit and differ in the first byte, then the last one.
assert has_prefix("xlaw-v0.1", 9, "claw-v", 6) == false;
assert has_prefix("claw-x0.1", 9, "claw-v", 6) == false;
// A string that is exactly the prefix is a prefix: `s_len < p_len` must not become `<=`.
assert has_prefix("claw-v", 6, "claw-v", 6) == true;
}

test put_count_clipped_write_leaves_the_byte_at_cap_alone {
// The clip is `w + k < cap`. With `<=` the last digit lands one byte past cap. Only a test
// that looks at the byte at cap can tell; the earlier tests never hand in a short cap.
var out : [8]u8 = undefined;
for i in 0..8 { out[i] = 0; }
var w : usize = put_count(&out, 3, 0, 1050);
assert w == 4;
assert buf_has(&out, 3, "105", 3) == true;
assert out[3] == 0;
}
Loading