(t *testing.T)
| 564 | } |
| 565 | |
| 566 | func TestCompactor_CompactWithVerification(t *testing.T) { |
| 567 | t.Run("VerificationEnabled", func(t *testing.T) { |
| 568 | client := file.NewReplicaClient(t.TempDir()) |
| 569 | compactor := litestream.NewCompactor(client, slog.Default()) |
| 570 | compactor.VerifyCompaction = true |
| 571 | |
| 572 | // Create contiguous L0 files |
| 573 | createTestLTXFile(t, client, 0, 1, 1) |
| 574 | createTestLTXFile(t, client, 0, 2, 2) |
| 575 | createTestLTXFile(t, client, 0, 3, 3) |
| 576 | |
| 577 | // Compact to L1 - should succeed with verification |
| 578 | info, err := compactor.Compact(context.Background(), 1) |
| 579 | if err != nil { |
| 580 | t.Fatal(err) |
| 581 | } |
| 582 | if info.Level != 1 { |
| 583 | t.Errorf("Level=%d, want 1", info.Level) |
| 584 | } |
| 585 | if info.MinTXID != 1 || info.MaxTXID != 3 { |
| 586 | t.Errorf("TXID range=%d-%d, want 1-3", info.MinTXID, info.MaxTXID) |
| 587 | } |
| 588 | }) |
| 589 | } |
| 590 | |
| 591 | // containsString checks if s contains substr. |
| 592 | func containsString(s, substr string) bool { |
nothing calls this directly
no test coverage detected