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

Function TestNoErrorWrapper

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

Source from the content-addressed store, hash-verified

310}
311
312func TestNoErrorWrapper(t *testing.T) {
313 t.Parallel()
314
315 assert := New(t)
316 mockAssert := New(new(testing.T))
317
318 // start with a nil error
319 var err error
320
321 assert.True(mockAssert.NoError(err), "NoError should return True for nil arg")
322
323 // now set an error
324 err = errors.New("Some error")
325
326 assert.False(mockAssert.NoError(err), "NoError with error should return False")
327
328}
329
330func TestErrorWrapper(t *testing.T) {
331 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
TrueMethod · 0.45
NoErrorMethod · 0.45
FalseMethod · 0.45

Tested by

no test coverage detected