Skip to content

Commit b6235aa

Browse files
committed
[-] updated errors.As test
1 parent 6efdf2b commit b6235aa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mirror_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package errors
33
import (
44
"errors"
55
"fmt"
6+
"strings"
67
"testing"
78
)
89

@@ -120,4 +121,10 @@ func TestAs(t *testing.T) {
120121
if !errors.As(err, &target) {
121122
t.Error("As() = false, want true")
122123
}
124+
out := target.Error()
125+
want := "github.com/bnkamalesh/errors/mirror_test.go:120: type *Error"
126+
if !strings.Contains(out, want) {
127+
t.Errorf("As() = %s, want %s", out, "xx")
128+
}
129+
123130
}

0 commit comments

Comments
 (0)