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

Function TestErrorContains

require/requirements_test.go:231–241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

229}
230
231func TestErrorContains(t *testing.T) {
232 t.Parallel()
233
234 ErrorContains(t, errors.New("some error: another error"), "some error")
235
236 mockT := new(MockT)
237 ErrorContains(mockT, errors.New("some error"), "different error")
238 if !mockT.Failed {
239 t.Error("Check should fail")
240 }
241}
242
243func TestEqualError(t *testing.T) {
244 t.Parallel()

Callers

nothing calls this directly

Calls 2

ErrorContainsFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected