Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 23f3423

Browse files
authoredJul 11, 2022
chore: add more tests (zeromicro#2129)
1 parent d71b3c8 commit 23f3423

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎core/errorx/wrap_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ import (
1010
func TestWrap(t *testing.T) {
1111
assert.Nil(t, Wrap(nil, "test"))
1212
assert.Equal(t, "foo: bar", Wrap(errors.New("bar"), "foo").Error())
13+
14+
err := errors.New("foo")
15+
assert.True(t, errors.Is(Wrap(err, "bar"), err))
1316
}
1417

1518
func TestWrapf(t *testing.T) {
1619
assert.Nil(t, Wrapf(nil, "%s", "test"))
1720
assert.Equal(t, "foo bar: quz", Wrapf(errors.New("quz"), "foo %s", "bar").Error())
21+
22+
err := errors.New("foo")
23+
assert.True(t, errors.Is(Wrapf(err, "foo %s", "bar"), err))
1824
}

0 commit comments

Comments
 (0)
Please sign in to comment.