MCPcopy
hub / github.com/expr-lang/expr / TestErrorContains

Function TestErrorContains

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

Source from the content-addressed store, hash-verified

1523}
1524
1525func TestErrorContains(t *testing.T) {
1526 mockT := new(testing.T)
1527
1528 // start with a nil error
1529 var err error
1530 False(t, ErrorContains(mockT, err, ""),
1531 "ErrorContains should return false for nil arg")
1532
1533 // now set an error
1534 err = errors.New("some error: another error")
1535 False(t, ErrorContains(mockT, err, "bad error"),
1536 "ErrorContains should return false for different error string")
1537 True(t, ErrorContains(mockT, err, "some error"),
1538 "ErrorContains should return true")
1539 True(t, ErrorContains(mockT, err, "another error"),
1540 "ErrorContains should return true")
1541}
1542
1543func Test_isEmpty(t *testing.T) {
1544

Callers

nothing calls this directly

Calls 3

FalseFunction · 0.70
ErrorContainsFunction · 0.70
TrueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…