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

Function TestErrorWrapper

assert/forward_assertions_test.go:330–346  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

328}
329
330func TestErrorWrapper(t *testing.T) {
331 t.Parallel()
332
333 assert := New(t)
334 mockAssert := New(new(testing.T))
335
336 // start with a nil error
337 var err error
338
339 assert.False(mockAssert.Error(err), "Error should return False for nil arg")
340
341 // now set an error
342 err = errors.New("Some error")
343
344 assert.True(mockAssert.Error(err), "Error with error should return True")
345
346}
347
348func TestErrorContainsWrapper(t *testing.T) {
349 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
FalseMethod · 0.45
ErrorMethod · 0.45
TrueMethod · 0.45

Tested by

no test coverage detected