MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / TestHeapExample1

Function TestHeapExample1

structure/heap/heap_test.go:64–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestHeapExample1(t *testing.T) {
65 tests1 := []testStruct[testInt]{
66 {
67 name: "example 1",
68 ops: []testOp[testInt]{
69 {typ: testEmpty, isEmpty: true},
70 {typ: testPush, x: 10},
71 {typ: testEmpty, isEmpty: false},
72 {typ: testTop, x: 10},
73 {typ: testPop},
74 {typ: testEmpty, isEmpty: true},
75 {typ: testPush, x: 9},
76 {typ: testPush, x: 8},
77 {typ: testPop},
78 {typ: testPush, x: 3},
79 {typ: testTop, x: 3},
80 {typ: testPush, x: 2},
81 {typ: testTop, x: 2},
82 {typ: testPush, x: 4},
83 {typ: testPush, x: 6},
84 {typ: testPush, x: 5},
85 {typ: testTop, x: 2},
86 {typ: testPop},
87 {typ: testTop, x: 3},
88 {typ: testPop},
89 {typ: testPop},
90 {typ: testTop, x: 5},
91 {typ: testEmpty, isEmpty: false},
92 },
93 },
94 }
95 testFunc(t, tests1, testInt.Less)
96}
97
98func TestHeapExample2(t *testing.T) {
99 tests1 := []testStruct[testStudent]{

Callers

nothing calls this directly

Calls 1

testFuncFunction · 0.85

Tested by

no test coverage detected