Skip to content

Commit 31e35ba

Browse files
committed
backup: #904 v20 - fix TestEncodeSnapshotRejectsZeroAdapterSet to pin the right guard
Claude v19 caught: the v19 MANIFEST.json gate (added to checkInputRoot) moved this test's failure point from the zero-adapter guard (the invariant the test name and comment claim it pins) to the MANIFEST.json-missing guard. The test still passed both assertions (non-nil error, buf.Len()==0) but for the wrong reason. Adding AllowMissingManifest: true so checkInputRoot waves through the missing manifest and validateEncodeOptions proceeds to the zero-adapter check that's the actual subject of the test. The other 10 synthetic-fixture EncodeSnapshot callers in v19 already got this flag; this one was missed because its rejection assertions were satisfied by the new guard, so the failure wasn't a hard error. Test-only; no behavior change. Tests + lint green.
1 parent f246ca9 commit 31e35ba

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

internal/backup/encode_snapshot_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,13 @@ func TestEncodeSnapshotRejectsZeroAdapterSet(t *testing.T) {
436436
InputRoot: in,
437437
Adapters: AdapterSet{}, // explicit zero
438438
LastCommitTS: 1,
439+
// AllowMissingManifest: true bypasses the v19 MANIFEST.json
440+
// guard so this test actually exercises the zero-adapter
441+
// guard further down in validateEncodeOptions — without this,
442+
// checkInputRoot would error on the missing MANIFEST.json
443+
// first and the assertion would pin the wrong invariant
444+
// (claude v19 #904).
445+
AllowMissingManifest: true,
439446
}, &buf)
440447
if err == nil {
441448
t.Fatalf("EncodeSnapshot with empty AdapterSet succeeded; want error")

0 commit comments

Comments
 (0)