MCPcopy
hub / github.com/kubernetes/client-go / TestLen

Function TestLen

util/workqueue/queue_test.go:117–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestLen(t *testing.T) {
118 q := workqueue.New()
119 q.Add("foo")
120 if e, a := 1, q.Len(); e != a {
121 t.Errorf("Expected %v, got %v", e, a)
122 }
123 q.Add("bar")
124 if e, a := 2, q.Len(); e != a {
125 t.Errorf("Expected %v, got %v", e, a)
126 }
127 q.Add("foo") // should not increase the queue length.
128 if e, a := 2, q.Len(); e != a {
129 t.Errorf("Expected %v, got %v", e, a)
130 }
131}
132
133func TestReinsert(t *testing.T) {
134 q := workqueue.New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
AddMethod · 0.65
LenMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected