MCPcopy Index your code
hub / github.com/cockroachdb/errors / TestFormat

Function TestFormat

barriers/barriers_test.go:103–198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func TestFormat(t *testing.T) {
104 tt := testutils.T{t}
105
106 const woo = `woo`
107 const waawoo = `waa: woo`
108 testCases := []struct {
109 name string
110 err error
111 expFmtSimple string
112 expFmtVerbose string
113 }{
114 {"handled", barriers.Handled(goErr.New("woo")), woo, `
115woo
116(1) woo
117 | -- cause hidden behind barrier
118 | woo
119 | (1) woo
120 | Error types: (1) *errors.errorString
121Error types: (1) *barriers.barrierErr`},
122
123 {"handled + handled", barriers.Handled(barriers.Handled(goErr.New("woo"))), woo, `
124woo
125(1) woo
126 | -- cause hidden behind barrier
127 | woo
128 | (1) woo
129 | | -- cause hidden behind barrier
130 | | woo
131 | | (1) woo
132 | | Error types: (1) *errors.errorString
133 | Error types: (1) *barriers.barrierErr
134Error types: (1) *barriers.barrierErr`},
135
136 {"handledmsg", barriers.HandledWithMessage(goErr.New("woo"), "waa"), "waa", `
137waa
138(1) waa
139 | -- cause hidden behind barrier
140 | woo
141 | (1) woo
142 | Error types: (1) *errors.errorString
143Error types: (1) *barriers.barrierErr`},
144
145 {"handledmsg + handledmsg", barriers.HandledWithMessage(
146 barriers.HandledWithMessage(
147 goErr.New("woo"), "waa"), "wuu"), `wuu`, `
148wuu
149(1) wuu
150 | -- cause hidden behind barrier
151 | waa
152 | (1) waa
153 | | -- cause hidden behind barrier
154 | | woo
155 | | (1) woo
156 | | Error types: (1) *errors.errorString
157 | Error types: (1) *barriers.barrierErr
158Error types: (1) *barriers.barrierErr`},
159
160 {"handled + wrapper",

Callers

nothing calls this directly

Calls 4

RunMethod · 0.95
CheckStringEqualMethod · 0.95
HandledFunction · 0.92
HandledWithMessageFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…