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

Function TestHeapExample2

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

Source from the content-addressed store, hash-verified

96}
97
98func TestHeapExample2(t *testing.T) {
99 tests1 := []testStruct[testStudent]{
100 {
101 name: "example 2",
102 ops: []testOp[testStudent]{
103 {typ: testPush, x: testStudent{Name: "Alan", Score: 87}},
104 {typ: testPush, x: testStudent{Name: "Bob", Score: 98}},
105 {typ: testTop, x: testStudent{Name: "Bob", Score: 98}},
106 {typ: testPop},
107 {typ: testPush, x: testStudent{Name: "Carl", Score: 70}},
108 {typ: testTop, x: testStudent{Name: "Alan", Score: 87}},
109 },
110 },
111 }
112 testFunc(t, tests1, testStudent.Less)
113}
114
115func testFunc[T any](t *testing.T, tests []testStruct[T], less func(a, b T) bool) {
116 for _, tt := range tests {

Callers

nothing calls this directly

Calls 1

testFuncFunction · 0.85

Tested by

no test coverage detected