(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestFormatNew(t *testing.T) { |
| 13 | tests := []struct { |
| 14 | error |
| 15 | format string |
| 16 | want string |
| 17 | }{{ |
| 18 | New("error"), |
| 19 | "%s", |
| 20 | "error", |
| 21 | }, { |
| 22 | New("error"), |
| 23 | "%v", |
| 24 | "error", |
| 25 | }, { |
| 26 | New("error"), |
| 27 | "%+v", |
| 28 | "error\n" + |
| 29 | "github.com/pkg/errors.TestFormatNew\n" + |
| 30 | "\t.+/github.com/pkg/errors/format_test.go:26", |
| 31 | }, { |
| 32 | New("error"), |
| 33 | "%q", |
| 34 | `"error"`, |
| 35 | }} |
| 36 | |
| 37 | for i, tt := range tests { |
| 38 | testFormatRegexp(t, i, tt.error, tt.format, tt.want) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func TestFormatErrorf(t *testing.T) { |
| 43 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…