MCPcopy Index your code
hub / github.com/SurgeDM/Surge / TestTaskQueue_Close

Function TestTaskQueue_Close

internal/engine/concurrent/task_queue_test.go:52–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestTaskQueue_Close(t *testing.T) {
53 q := NewTaskQueue()
54 q.Push(types.Task{Offset: 0, Length: 100})
55 q.Close()
56
57 // After close, Pop should still return existing tasks
58 if _, ok := q.Pop(); !ok {
59 t.Error("Pop should return existing task after Close")
60 }
61
62 // Additional Pop should return false
63 if _, ok := q.Pop(); ok {
64 t.Error("Pop should return false after draining closed queue")
65 }
66}
67
68func TestTaskQueue_DrainRemaining(t *testing.T) {
69 q := NewTaskQueue()

Callers

nothing calls this directly

Calls 5

PushMethod · 0.95
CloseMethod · 0.95
PopMethod · 0.95
NewTaskQueueFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected