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

Function TestErrorContainsWrapper

require/forward_requirements_test.go:243–255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

241}
242
243func TestErrorContainsWrapper(t *testing.T) {
244 t.Parallel()
245
246 require := New(t)
247 require.ErrorContains(errors.New("some error: another error"), "some error")
248
249 mockT := new(MockT)
250 mockRequire := New(mockT)
251 mockRequire.ErrorContains(errors.New("some error: another error"), "different error")
252 if !mockT.Failed {
253 t.Error("Check should fail")
254 }
255}
256
257func TestEqualErrorWrapper(t *testing.T) {
258 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
ErrorContainsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected