Added more Stack tests
diff --git a/errors_test.go b/errors_test.go
index 53c3af1..7ffd7db 100644
--- a/errors_test.go
+++ b/errors_test.go
@@ -208,6 +208,21 @@
Cause(Wrap(New("ooh"), "ahh")), []fileline{
{"github.com/pkg/errors/errors_test.go", 208}, // this is the stack of New
},
+ }, {
+ func() error { return New("ooh") }(), []fileline{
+ {"github.com/pkg/errors/errors_test.go", 212}, // this is the stack of New
+ {"github.com/pkg/errors/errors_test.go", 212}, // this is the stack of New's caller
+ },
+ }, {
+ Cause(func() error {
+ return func() error {
+ return Errorf("hello %s", fmt.Sprintf("world"))
+ }()
+ }()), []fileline{
+ {"github.com/pkg/errors/errors_test.go", 219}, // this is the stack of Errorf
+ {"github.com/pkg/errors/errors_test.go", 220}, // this is the stack of Errorf's caller
+ {"github.com/pkg/errors/errors_test.go", 221}, // this is the stack of Errorf's caller's caller
+ },
}}
for _, tt := range tests {
x, ok := tt.err.(interface {