From 335ad0cd85d4c2d0c9798c0a2591ed514ac06e1b Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 2 Oct 2026 17:20:38 +0200 Subject: [PATCH] test: second review -- the upload chat model outside the chain, room checked before spooling, a cut-off body is a 400, bidi controls in titles, the ensemble's deadline wiring, an honest test name (red) Co-Authored-By: Claude Sonnet 5.5 --- internal/uploads/worker_queue_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/uploads/worker_queue_test.go b/internal/uploads/worker_queue_test.go index 259693d..cb71d3a 100644 --- a/internal/uploads/worker_queue_test.go +++ b/internal/uploads/worker_queue_test.go @@ -78,3 +78,15 @@ func TestWorkerSubmit_AJobThatHasLeftTheQueueFreesItsPlace(t *testing.T) { assert.NoError(t, w.Submit(r.spool(t, "second")), "the cap counts jobs waiting, not jobs ever submitted") } + +func TestWorkerHasRoom_SaysWhetherASubmitWouldBeAccepted(t *testing.T) { + w := queueWorker(t, 3, 2) + assert.True(t, w.HasRoom("alice")) + require.NoError(t, submit(w, "alice", 1)) + require.NoError(t, submit(w, "alice", 2)) + + assert.False(t, w.HasRoom("alice"), "alice is at her share") + assert.True(t, w.HasRoom("bob"), "bob is not") + require.NoError(t, submit(w, "bob", 1)) + assert.False(t, w.HasRoom("carol"), "the queue as a whole is at its cap") +}