This repository was archived by the owner on Dec 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,21 @@ func TestStack(t *testing.T) {
208208 Cause (Wrap (New ("ooh" ), "ahh" )), []fileline {
209209 {"github.com/pkg/errors/errors_test.go" , 208 }, // this is the stack of New
210210 },
211+ }, {
212+ func () error { return New ("ooh" ) }(), []fileline {
213+ {"github.com/pkg/errors/errors_test.go" , 212 }, // this is the stack of New
214+ {"github.com/pkg/errors/errors_test.go" , 212 }, // this is the stack of New's caller
215+ },
216+ }, {
217+ Cause (func () error {
218+ return func () error {
219+ return Errorf ("hello %s" , fmt .Sprintf ("world" ))
220+ }()
221+ }()), []fileline {
222+ {"github.com/pkg/errors/errors_test.go" , 219 }, // this is the stack of Errorf
223+ {"github.com/pkg/errors/errors_test.go" , 220 }, // this is the stack of Errorf's caller
224+ {"github.com/pkg/errors/errors_test.go" , 221 }, // this is the stack of Errorf's caller's caller
225+ },
211226 }}
212227 for _ , tt := range tests {
213228 x , ok := tt .err .(interface {
You can’t perform that action at this time.
0 commit comments