MCPcopy Create free account
hub / github.com/stretchr/testify / TestEqualError

Function TestEqualError

assert/assertions_test.go:1625–1639  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1623}
1624
1625func TestEqualError(t *testing.T) {
1626 mockT := new(testing.T)
1627
1628 // start with a nil error
1629 var err error
1630 False(t, EqualError(mockT, err, ""),
1631 "EqualError should return false for nil arg")
1632
1633 // now set an error
1634 err = errors.New("some error")
1635 False(t, EqualError(mockT, err, "Not some error"),
1636 "EqualError should return false for different error string")
1637 True(t, EqualError(mockT, err, "some error"),
1638 "EqualError should return true")
1639}
1640
1641func TestErrorContains(t *testing.T) {
1642 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