(t *testing.T)
| 1517 | } |
| 1518 | |
| 1519 | func TestPanicsWithError(t *testing.T) { |
| 1520 | |
| 1521 | mockT := new(testing.T) |
| 1522 | |
| 1523 | if !PanicsWithError(mockT, "panic", func() { |
| 1524 | panic(errors.New("panic")) |
| 1525 | }) { |
| 1526 | t.Error("PanicsWithError should return true") |
| 1527 | } |
| 1528 | |
| 1529 | if PanicsWithError(mockT, "Panic!", func() { |
| 1530 | }) { |
| 1531 | t.Error("PanicsWithError should return false") |
| 1532 | } |
| 1533 | |
| 1534 | if PanicsWithError(mockT, "at the disco", func() { |
| 1535 | panic(errors.New("panic")) |
| 1536 | }) { |
| 1537 | t.Error("PanicsWithError should return false") |
| 1538 | } |
| 1539 | |
| 1540 | if PanicsWithError(mockT, "Panic!", func() { |
| 1541 | panic("panic") |
| 1542 | }) { |
| 1543 | t.Error("PanicsWithError should return false") |
| 1544 | } |
| 1545 | } |
| 1546 | |
| 1547 | func TestNotPanics(t *testing.T) { |
| 1548 |
nothing calls this directly
no test coverage detected