(t *testing.T)
| 117 | } |
| 118 | |
| 119 | func TestQueueRemoveOutOfRangePanics(t *testing.T) { |
| 120 | q := New() |
| 121 | |
| 122 | assertPanics(t, "should panic when removing empty queue", func() { |
| 123 | q.Remove() |
| 124 | }) |
| 125 | |
| 126 | q.Add(1) |
| 127 | q.Remove() |
| 128 | |
| 129 | assertPanics(t, "should panic when removing emptied queue", func() { |
| 130 | q.Remove() |
| 131 | }) |
| 132 | } |
| 133 | |
| 134 | func assertPanics(t *testing.T, name string, f func()) { |
| 135 | defer func() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…