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

Function TestFormatErrorf

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

Source from the content-addressed store, hash-verified

40}
41
42func TestFormatErrorf(t *testing.T) {
43 tests := []struct {
44 error
45 format string
46 want string
47 }{{
48 Errorf("%s", "error"),
49 "%s",
50 "error",
51 }, {
52 Errorf("%s", "error"),
53 "%v",
54 "error",
55 }, {
56 Errorf("%s", "error"),
57 "%+v",
58 "error\n" +
59 "github.com/pkg/errors.TestFormatErrorf\n" +
60 "\t.+/github.com/pkg/errors/format_test.go:56",
61 }}
62
63 for i, tt := range tests {
64 testFormatRegexp(t, i, tt.error, tt.format, tt.want)
65 }
66}
67
68func TestFormatWrap(t *testing.T) {
69 tests := []struct {

Callers

nothing calls this directly

Calls 2

ErrorfFunction · 0.85
testFormatRegexpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…