test(cli): the rename journey counts a verify that wrote nothing as no frame

A verify that finds nothing to heal writes no journal line, so it has no
call frame (WB-format-8). The rename journey counted a closing line for it
and so expected one line more than the journal holds. The refusals now
compare the raw journal byte for byte, and the counts are what the journal
holds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 11:42:02 -07:00
1 parent af77939f62
commit 1ad6d9e41c
1 file changed
+12 -6
+12 -6
View File
@@ -2986,6 +2986,7 @@ fn rename_account_end_to_end_defect_15() {
post_pair(&mut mcp, "2025-11-20", "6150", "1000", "29.00"); post_pair(&mut mcp, "2025-11-20", "6150", "1000", "29.00");
let verified = mcp.call("books.verify", json!({"blobs": false})); let verified = mcp.call("books.verify", json!({"blobs": false}));
let events = verified["events"].as_u64().unwrap(); let events = verified["events"].as_u64().unwrap();
let journal_before = books.journal_raw();
for (name, says) in [ for (name, says) in [
("", "must not be empty"), ("", "must not be empty"),
(" Software ", "already named"), (" Software ", "already named"),
@@ -2998,11 +2999,17 @@ fn rename_account_end_to_end_defect_15() {
); );
assert!(err.contains(says), "{name:?}: {err}"); assert!(err.contains(says), "{name:?}: {err}");
} }
// (The first verify is a call too: its own closing line is the one // A verify that finds nothing to heal writes no line, so it has no
// line the second counts more; the refusals wrote none.) // frame (WB-format-8); and the refusals, decided before anything is
// written, left the journal byte for byte as it was.
assert_eq!(
books.journal_raw(),
journal_before,
"refusals write nothing"
);
assert_eq!( assert_eq!(
mcp.call("books.verify", json!({"blobs": false}))["events"], mcp.call("books.verify", json!({"blobs": false}))["events"],
json!(events + 1), json!(events),
"refusals write nothing" "refusals write nothing"
); );
let out = mcp.call( let out = mcp.call(
@@ -3022,9 +3029,8 @@ fn rename_account_end_to_end_defect_15() {
assert_eq!(after["status"], "ok"); assert_eq!(after["status"], "ok");
// New books declare account_renamed (with the rest of this version's // New books declare account_renamed (with the rest of this version's
// format) as they are created: the rename journals only itself, in // format) as they are created: the rename journals only itself, in
// its frame (begun, the rename, closed), after the two verifies' // its frame (begun, the rename, closed); the verifies wrote nothing.
// closing lines. assert_eq!(after["events"], json!(events + 3), "the rename");
assert_eq!(after["events"], json!(events + 1 + 1 + 3), "the rename");
let chart = mcp.call("books.chart", json!({})); let chart = mcp.call("books.chart", json!({}));
let acct = chart["accounts"] let acct = chart["accounts"]
.as_array() .as_array()