: test-queue-depth ( -- )
    chan.make   # work
    chan.make   # results

    2dup [ swap chan.receive drop 20 time.sleep-ms 1 i.+ over chan.send drop
           swap chan.receive drop 20 time.sleep-ms 1 i.+ over chan.send drop
           swap chan.receive drop 20 time.sleep-ms 1 i.+ over chan.send drop
           drop drop ] strand.spawn drop
    drop drop

    time.now

    rot 1 swap chan.send drop
    rot 1 swap chan.send drop
    rot 1 swap chan.send drop

    # Receive 3 results and sum
    rot dup chan.receive drop
    over chan.receive drop i.+
    over chan.receive drop i.+
    # Stack: ( start results sum )
    nip nip   # ( start sum )
    6 test.assert-eq
;
