Verification #23 · 2026-10-16 · End of test · Medium · about 12 min
The test that ends with items still queued
In env.sv, a generator puts items in a mailbox and a driver takes them out and drives them, one at a time. env.run(n) runs one test of n items (n is at least 1), and may be called again for the next test. It must:
- return only when the driver has driven all
nitems all the way, at the time the last one finishes, - leave nothing running: once it returns, the driver's loop has been stopped, so an item put in the mailbox later stays there.
The visible test sends eight items, and run(8) comes back with only two of them driven. Fix env::run.
Write and run your answer in the browser. The hidden tests check it, and it’s free.