import { test } from '@japa/runner' import { cut, uncovered } from '#lib/seed/plan' test.group('seed plan', () => { test('plans only what earlier ranges leave uncovered', ({ assert }) => { // a.b.ath on 2026-10-06: test ranges around 49.8B and a plan below them; the backfill ends at 58.4B. assert.deepEqual(uncovered(1, 100, [[40, 50], [10, 20], [45, 60]]), [[1, 9], [21, 39], [61, 100]]) assert.deepEqual(uncovered(1, 100, []), [[1, 100]]) assert.deepEqual(uncovered(1, 100, [[0, 200]]), []) assert.deepEqual(uncovered(10, 20, [[1, 5], [25, 30]]), [[10, 20]]) }) test('cuts gaps into ranges, newest first', ({ assert }) => { assert.deepEqual(cut([[1, 9], [61, 100]], 25), [[76, 100], [61, 75], [1, 9]]) }) })