(t *testing.T)
| 1556 | } |
| 1557 | |
| 1558 | func TestPanicsWithValue(t *testing.T) { |
| 1559 | t.Parallel() |
| 1560 | |
| 1561 | mockT := new(testing.T) |
| 1562 | |
| 1563 | if !PanicsWithValue(mockT, "Panic!", func() { |
| 1564 | panic("Panic!") |
| 1565 | }) { |
| 1566 | t.Error("PanicsWithValue should return true") |
| 1567 | } |
| 1568 | |
| 1569 | if !PanicsWithValue(mockT, nil, func() { |
| 1570 | panic(nil) |
| 1571 | }) { |
| 1572 | t.Error("PanicsWithValue should return true") |
| 1573 | } |
| 1574 | |
| 1575 | if PanicsWithValue(mockT, "Panic!", func() { |
| 1576 | }) { |
| 1577 | t.Error("PanicsWithValue should return false") |
| 1578 | } |
| 1579 | |
| 1580 | if PanicsWithValue(mockT, "at the disco", func() { |
| 1581 | panic("Panic!") |
| 1582 | }) { |
| 1583 | t.Error("PanicsWithValue should return false") |
| 1584 | } |
| 1585 | } |
| 1586 | |
| 1587 | func TestPanicsWithError(t *testing.T) { |
| 1588 | t.Parallel() |
nothing calls this directly
no test coverage detected