(t *testing.T)
| 62 | } |
| 63 | |
| 64 | func 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 | |
| 98 | func TestHeapExample2(t *testing.T) { |
| 99 | tests1 := []testStruct[testStudent]{ |
nothing calls this directly
no test coverage detected