(t *testing.T)
| 1373 | } |
| 1374 | |
| 1375 | func TestPanicsWithValue(t *testing.T) { |
| 1376 | |
| 1377 | mockT := new(testing.T) |
| 1378 | |
| 1379 | if !PanicsWithValue(mockT, "Panic!", func() { |
| 1380 | panic("Panic!") |
| 1381 | }) { |
| 1382 | t.Error("PanicsWithValue should return true") |
| 1383 | } |
| 1384 | |
| 1385 | if !PanicsWithValue(mockT, nil, func() { |
| 1386 | panic(nil) |
| 1387 | }) { |
| 1388 | t.Error("PanicsWithValue should return true") |
| 1389 | } |
| 1390 | |
| 1391 | if PanicsWithValue(mockT, "Panic!", func() { |
| 1392 | }) { |
| 1393 | t.Error("PanicsWithValue should return false") |
| 1394 | } |
| 1395 | |
| 1396 | if PanicsWithValue(mockT, "at the disco", func() { |
| 1397 | panic("Panic!") |
| 1398 | }) { |
| 1399 | t.Error("PanicsWithValue should return false") |
| 1400 | } |
| 1401 | } |
| 1402 | |
| 1403 | func TestPanicsWithError(t *testing.T) { |
| 1404 |
nothing calls this directly
no test coverage detected
searching dependent graphs…