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

Function TestEqualError

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

Source from the content-addressed store, hash-verified

1507}
1508
1509func TestEqualError(t *testing.T) {
1510 mockT := new(testing.T)
1511
1512 // start with a nil error
1513 var err error
1514 False(t, EqualError(mockT, err, ""),
1515 "EqualError should return false for nil arg")
1516
1517 // now set an error
1518 err = errors.New("some error")
1519 False(t, EqualError(mockT, err, "Not some error"),
1520 "EqualError should return false for different error string")
1521 True(t, EqualError(mockT, err, "some error"),
1522 "EqualError should return true")
1523}
1524
1525func TestErrorContains(t *testing.T) {
1526 mockT := new(testing.T)

Callers

nothing calls this directly

Calls 3

FalseFunction · 0.70
EqualErrorFunction · 0.70
TrueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…