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

Function TestEqualErrorWrapper

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

Source from the content-addressed store, hash-verified

367}
368
369func TestEqualErrorWrapper(t *testing.T) {
370 t.Parallel()
371
372 assert := New(t)
373 mockAssert := New(new(testing.T))
374
375 // start with a nil error
376 var err error
377 assert.False(mockAssert.EqualError(err, ""),
378 "EqualError should return false for nil arg")
379
380 // now set an error
381 err = errors.New("some error")
382 assert.False(mockAssert.EqualError(err, "Not some error"),
383 "EqualError should return false for different error string")
384 assert.True(mockAssert.EqualError(err, "some error"),
385 "EqualError should return true")
386}
387
388func TestEmptyWrapper(t *testing.T) {
389 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
FalseMethod · 0.45
EqualErrorMethod · 0.45
TrueMethod · 0.45

Tested by

no test coverage detected