From 1ad6d9e41cbcf589986e1a42a4b74b19fa3755bc Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sat, 21 Nov 2026 11:42:02 -0700 Subject: [PATCH] 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 --- crates/ledger-cli/tests/mcp_journeys.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/ledger-cli/tests/mcp_journeys.rs b/crates/ledger-cli/tests/mcp_journeys.rs index b76932e7..8065e9c8 100644 --- a/crates/ledger-cli/tests/mcp_journeys.rs +++ b/crates/ledger-cli/tests/mcp_journeys.rs @@ -2986,6 +2986,7 @@ fn rename_account_end_to_end_defect_15() { post_pair(&mut mcp, "2025-11-20", "6150", "1000", "29.00"); let verified = mcp.call("books.verify", json!({"blobs": false})); let events = verified["events"].as_u64().unwrap(); + let journal_before = books.journal_raw(); for (name, says) in [ ("", "must not be empty"), (" Software ", "already named"), @@ -2998,11 +2999,17 @@ fn rename_account_end_to_end_defect_15() { ); assert!(err.contains(says), "{name:?}: {err}"); } - // (The first verify is a call too: its own closing line is the one - // line the second counts more; the refusals wrote none.) + // A verify that finds nothing to heal writes no line, so it has no + // 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!( mcp.call("books.verify", json!({"blobs": false}))["events"], - json!(events + 1), + json!(events), "refusals write nothing" ); let out = mcp.call( @@ -3022,9 +3029,8 @@ fn rename_account_end_to_end_defect_15() { assert_eq!(after["status"], "ok"); // New books declare account_renamed (with the rest of this version's // format) as they are created: the rename journals only itself, in - // its frame (begun, the rename, closed), after the two verifies' - // closing lines. - assert_eq!(after["events"], json!(events + 1 + 1 + 3), "the rename"); + // its frame (begun, the rename, closed); the verifies wrote nothing. + assert_eq!(after["events"], json!(events + 3), "the rename"); let chart = mcp.call("books.chart", json!({})); let acct = chart["accounts"] .as_array()