Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 1398fbc

Browse files
fabstudavecheney
authored andcommitted
tests: fixed tests on 1.4.
1 parent 162fea7 commit 1398fbc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

format_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,21 +333,21 @@ func TestFormatGeneric(t *testing.T) {
333333
}, {
334334
func(err error) error { return WithStack(err) },
335335
[]string{
336-
"github.com/pkg/errors.TestFormatGeneric.func2\n\t" +
336+
"github.com/pkg/errors.(func·002|TestFormatGeneric.func2)\n\t" +
337337
".+/github.com/pkg/errors/format_test.go:329",
338338
},
339339
}, {
340340
func(err error) error { return Wrap(err, "wrap-error") },
341341
[]string{
342342
"wrap-error",
343-
"github.com/pkg/errors.TestFormatGeneric.func3\n\t" +
343+
"github.com/pkg/errors.(func·003|TestFormatGeneric.func3)\n\t" +
344344
".+/github.com/pkg/errors/format_test.go:335",
345345
},
346346
}, {
347347
func(err error) error { return Wrapf(err, "wrapf-error%d", 1) },
348348
[]string{
349349
"wrapf-error1",
350-
"github.com/pkg/errors.TestFormatGeneric.func4\n\t" +
350+
"github.com/pkg/errors.(func·004|TestFormatGeneric.func4)\n\t" +
351351
".+/github.com/pkg/errors/format_test.go:342",
352352
},
353353
},

stack_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ func TestTrimGOPATH(t *testing.T) {
155155
"github.com/pkg/errors/stack_test.go",
156156
}}
157157

158-
for _, tt := range tests {
158+
for i, tt := range tests {
159159
pc := tt.Frame.pc()
160160
fn := runtime.FuncForPC(pc)
161161
file, _ := fn.FileLine(pc)
162162
got := trimGOPATH(fn.Name(), file)
163-
testFormatRegexp(t, got, "%s", tt.want)
163+
testFormatRegexp(t, i, got, "%s", tt.want)
164164
}
165165
}
166166

@@ -185,7 +185,7 @@ func TestStackTrace(t *testing.T) {
185185
},
186186
}, {
187187
func() error { return New("ooh") }(), []string{
188-
`github.com/pkg/errors.(func·005|TestStackTrace.func1)` +
188+
`github.com/pkg/errors.(func·009|TestStackTrace.func1)` +
189189
"\n\t.+/github.com/pkg/errors/stack_test.go:187", // this is the stack of New
190190
"github.com/pkg/errors.TestStackTrace\n" +
191191
"\t.+/github.com/pkg/errors/stack_test.go:187", // this is the stack of New's caller
@@ -196,9 +196,9 @@ func TestStackTrace(t *testing.T) {
196196
return Errorf("hello %s", fmt.Sprintf("world"))
197197
}()
198198
}()), []string{
199-
`github.com/pkg/errors.(func·006|TestStackTrace.func2.1)` +
199+
`github.com/pkg/errors.(func·010|TestStackTrace.func2.1)` +
200200
"\n\t.+/github.com/pkg/errors/stack_test.go:196", // this is the stack of Errorf
201-
`github.com/pkg/errors.(func·007|TestStackTrace.func2)` +
201+
`github.com/pkg/errors.(func·011|TestStackTrace.func2)` +
202202
"\n\t.+/github.com/pkg/errors/stack_test.go:197", // this is the stack of Errorf's caller
203203
"github.com/pkg/errors.TestStackTrace\n" +
204204
"\t.+/github.com/pkg/errors/stack_test.go:198", // this is the stack of Errorf's caller's caller

0 commit comments

Comments
 (0)