MCPcopy
hub / github.com/pkg/errors / TestFormatNew

Function TestFormatNew

format_test.go:12–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func 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
42func TestFormatErrorf(t *testing.T) {
43 tests := []struct {

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
testFormatRegexpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…