Skip to content

Commit 443e9b5

Browse files
committed
backup: #904 v18 - add ErrEncodeAdapterData assertion to multi-DB rejection test
Claude v17 noted a pre-existing parity gap: TestEncodeSnapshotRedisRejectsMultipleDBs asserts errors.Is(ErrRedisEncodeMultiDBUnsupported) but not errors.Is(ErrEncodeAdapterData), while its sibling TestEncodeSnapshotRedisRejectsNonZeroDB asserts both. Both paths exit runAdapterEncoders through the same errors.Mark wrap so both sentinels should hold. Adding the missing assertion for parity. Test-only; no behavior change. Tests + lint green.
1 parent 786448f commit 443e9b5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/backup/encode_snapshot_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,11 @@ func TestEncodeSnapshotRedisRejectsMultipleDBs(t *testing.T) {
527527
if !errors.Is(err, ErrRedisEncodeMultiDBUnsupported) {
528528
t.Errorf("err = %v, want errors.Is ErrRedisEncodeMultiDBUnsupported", err)
529529
}
530+
// Marked as adapter-data so the CLI routes it to exit-2 (mirrors
531+
// TestEncodeSnapshotRedisRejectsNonZeroDB; claude v17 parity).
532+
if !errors.Is(err, ErrEncodeAdapterData) {
533+
t.Errorf("err = %v, want errors.Is ErrEncodeAdapterData (mark from runAdapterEncoders)", err)
534+
}
530535
if buf.Len() != 0 {
531536
t.Errorf("buf.Len = %d, want 0 (no bytes should be written on multi-DB rejection)", buf.Len())
532537
}

0 commit comments

Comments
 (0)