30/32
Part 7 of 7 · Follow-upsLearn and do
What tests would you write? A checker first, then the edge cases
Write a checker rather than one expected list: every task once, and every pair pointing forward. Then the inputs:
- no tasks, one task, and tasks in no pair
- a repeated pair
- a chain listed backwards
- a task whose prerequisites sit at different depths
- a cycle with nothing ready, a cycle behind tasks that can run, and a task that needs itself
- a zero-minute task, and a done time that isn't the last task's
- a chain thousands long, listed in both directions, to catch the recursion limit
The editor holds the pipeline and the order that put deploy before package. Write problems, which names each task that is wrong in an order.