MCPcopy
hub / github.com/stretchr/testify / TestEqualError

Function TestEqualError

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

Source from the content-addressed store, hash-verified

1694}
1695
1696func TestEqualError(t *testing.T) {
1697 t.Parallel()
1698
1699 mockT := new(testing.T)
1700
1701 // start with a nil error
1702 var err error
1703 False(t, EqualError(mockT, err, ""),
1704 "EqualError should return false for nil arg")
1705
1706 // now set an error
1707 err = errors.New("some error")
1708 False(t, EqualError(mockT, err, "Not some error"),
1709 "EqualError should return false for different error string")
1710 True(t, EqualError(mockT, err, "some error"),
1711 "EqualError should return true")
1712}
1713
1714func TestErrorContains(t *testing.T) {
1715 t.Parallel()

Callers

nothing calls this directly

Calls 3

FalseFunction · 0.70
EqualErrorFunction · 0.70
TrueFunction · 0.70

Tested by

no test coverage detected