package graph import "testing" func TestWALCheckpointNeededOnlyForLargeCleanWAL(t *testing.T) { const threshold int64 = 128 << 20 if walCheckpointNeeded(true, threshold*2, threshold) { t.Fatal("dirty graphs must not trigger a truncating WAL checkpoint") } if walCheckpointNeeded(false, threshold-1, threshold) { t.Fatal("small WAL files must not trigger a truncating checkpoint") } if !walCheckpointNeeded(false, threshold, threshold) { t.Fatal("a clean WAL at the threshold must be checkpointed") } }