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

Function TestHeap_Close

tools/cache/heap_test.go:292–304  ·  view source on GitHub ↗

TestHeap_Close tests Heap.Close and Heap.IsClosed functions.

(t *testing.T)

Source from the content-addressed store, hash-verified

290
291// TestHeap_Close tests Heap.Close and Heap.IsClosed functions.
292func TestHeap_Close(t *testing.T) {
293 h := NewHeap(testHeapObjectKeyFunc, compareInts)
294 h.Add(mkHeapObj("foo", 10))
295 h.Add(mkHeapObj("bar", 1))
296
297 if h.IsClosed() {
298 t.Fatalf("didn't expect heap to be closed")
299 }
300 h.Close()
301 if !h.IsClosed() {
302 t.Fatalf("expect heap to be closed")
303 }
304}
305
306// TestHeap_List tests Heap.List function.
307func TestHeap_List(t *testing.T) {

Callers

nothing calls this directly

Calls 5

AddMethod · 0.95
IsClosedMethod · 0.95
CloseMethod · 0.95
NewHeapFunction · 0.85
mkHeapObjFunction · 0.85

Tested by

no test coverage detected