(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func 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 | |
| 115 | func testFunc[T any](t *testing.T, tests []testStruct[T], less func(a, b T) bool) { |
| 116 | for _, tt := range tests { |
nothing calls this directly
no test coverage detected