MCPcopy Create free account
hub / github.com/krau/SaveAny-Bot / TestAddAndLength

Function TestAddAndLength

pkg/queue/queue_test.go:17–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15}
16
17func TestAddAndLength(t *testing.T) {
18 q := queue.NewTaskQueue[int]()
19 if q.Length() != 0 {
20 t.Fatalf("expected length 0, got %d", q.Length())
21 }
22 t1 := newTask("t1")
23 if err := q.Add(t1); err != nil {
24 t.Fatalf("unexpected error on Add: %v", err)
25 }
26 if q.Length() != 1 {
27 t.Fatalf("expected length 1, got %d", q.Length())
28 }
29}
30
31func TestDuplicateAdd(t *testing.T) {
32 q := queue.NewTaskQueue[int]()

Callers

nothing calls this directly

Calls 3

newTaskFunction · 0.85
LengthMethod · 0.80
AddMethod · 0.80

Tested by

no test coverage detected