(t *testing.T)
| 1401 | } |
| 1402 | |
| 1403 | func TestPanicsWithError(t *testing.T) { |
| 1404 | |
| 1405 | mockT := new(testing.T) |
| 1406 | |
| 1407 | if !PanicsWithError(mockT, "panic", func() { |
| 1408 | panic(errors.New("panic")) |
| 1409 | }) { |
| 1410 | t.Error("PanicsWithError should return true") |
| 1411 | } |
| 1412 | |
| 1413 | if PanicsWithError(mockT, "Panic!", func() { |
| 1414 | }) { |
| 1415 | t.Error("PanicsWithError should return false") |
| 1416 | } |
| 1417 | |
| 1418 | if PanicsWithError(mockT, "at the disco", func() { |
| 1419 | panic(errors.New("panic")) |
| 1420 | }) { |
| 1421 | t.Error("PanicsWithError should return false") |
| 1422 | } |
| 1423 | |
| 1424 | if PanicsWithError(mockT, "Panic!", func() { |
| 1425 | panic("panic") |
| 1426 | }) { |
| 1427 | t.Error("PanicsWithError should return false") |
| 1428 | } |
| 1429 | } |
| 1430 | |
| 1431 | func TestNotPanics(t *testing.T) { |
| 1432 |
nothing calls this directly
no test coverage detected
searching dependent graphs…