MCPcopy Index your code
hub / github.com/expr-lang/expr / TestPanicsWithValue

Function TestPanicsWithValue

internal/testify/assert/assertions_test.go:1375–1401  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1373}
1374
1375func 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
1403func TestPanicsWithError(t *testing.T) {
1404

Callers

nothing calls this directly

Calls 2

PanicsWithValueFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…