Skip to content

Commit

Permalink
Add unit test for ErrWrap/ErrWrapL
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendc committed Nov 1, 2024
1 parent d0db628 commit ef1d736
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_ErrWrap(t *testing.T) {
e := errors.New("err")
assert.Equal(t, "err: msg", ErrWrap(e, "msg").Error())
assert.Equal(t, "msg: err", ErrWrapL("msg", e).Error())
}

type wrappedErrs struct { //nolint:errname
errs []error
}
Expand Down

0 comments on commit ef1d736

Please sign in to comment.