@@ -130,18 +130,6 @@ func TestFormatErrorInternal(t *testing.T) {
130
130
Wraps: (2) ab
131
131
Wraps: (3) b
132
132
Error types: (1) *fmt.wrapError (2) *fmt.wrapError (3) *errors.errorString` ,
133
- },
134
- {
135
- name : "simple multi-wrapper" ,
136
- err : goErr .Join (goErr .New ("a" ), goErr .New ("b" )),
137
- expectedSimple : "a\n b" ,
138
- // TODO(davidh): verbose test case should have line break
139
- // between `a` and `b` on second line.
140
- expectedVerbose : `a
141
- (1) ab
142
- Wraps: (2) b
143
- Wraps: (3) a
144
- Error types: (1) *errors.joinError (2) *errors.errorString (3) *errors.errorString` ,
145
133
},
146
134
{
147
135
name : "multi-wrapper with custom formatter and partial elide" ,
@@ -190,91 +178,6 @@ Error types: (1) *errbase.wrapNoElideCauses (2) *errbase.wrapNoElideCauses (3) *
190
178
| c
191
179
| d
192
180
Error types: (1) *errors.errorString` ,
193
- },
194
- {
195
- name : "two-level multi-wrapper" ,
196
- err : goErr .Join (
197
- goErr .Join (goErr .New ("a" ), goErr .New ("b" )),
198
- goErr .Join (goErr .New ("c" ), goErr .New ("d" )),
199
- ),
200
- expectedSimple : "a\n b\n c\n d" ,
201
- // TODO(davidh): verbose output should preserve line breaks after (1)
202
- // and also after (2) and (5) in `c\nd` and `a\nb`.
203
- expectedVerbose : `a
204
- (1) ab
205
- |
206
- | c
207
- | d
208
- Wraps: (2) cd
209
- └─ Wraps: (3) d
210
- └─ Wraps: (4) c
211
- Wraps: (5) ab
212
- └─ Wraps: (6) b
213
- └─ Wraps: (7) a
214
- Error types: (1) *errors.joinError (2) *errors.joinError (3) *errors.errorString (4) *errors.errorString (5) *errors.joinError (6) *errors.errorString (7) *errors.errorString` ,
215
- },
216
- {
217
- name : "simple multi-wrapper with single-cause chains inside" ,
218
- err : goErr .Join (
219
- fmt .Errorf ("a%w" , goErr .New ("b" )),
220
- fmt .Errorf ("c%w" , goErr .New ("d" )),
221
- ),
222
- expectedSimple : "ab\n cd" ,
223
- expectedVerbose : `ab
224
- (1) ab
225
- | cd
226
- Wraps: (2) cd
227
- └─ Wraps: (3) d
228
- Wraps: (4) ab
229
- └─ Wraps: (5) b
230
- Error types: (1) *errors.joinError (2) *fmt.wrapError (3) *errors.errorString (4) *fmt.wrapError (5) *errors.errorString` ,
231
- },
232
- {
233
- name : "multi-cause wrapper with single-cause chains inside" ,
234
- err : goErr .Join (
235
- fmt .Errorf ("a%w" , fmt .Errorf ("b%w" , fmt .Errorf ("c%w" , goErr .New ("d" )))),
236
- fmt .Errorf ("e%w" , fmt .Errorf ("f%w" , fmt .Errorf ("g%w" , goErr .New ("h" )))),
237
- ),
238
- expectedSimple : `abcd
239
- efgh` ,
240
- expectedVerbose : `abcd
241
- (1) abcd
242
- | efgh
243
- Wraps: (2) efgh
244
- └─ Wraps: (3) fgh
245
- └─ Wraps: (4) gh
246
- └─ Wraps: (5) h
247
- Wraps: (6) abcd
248
- └─ Wraps: (7) bcd
249
- └─ Wraps: (8) cd
250
- └─ Wraps: (9) d
251
- Error types: (1) *errors.joinError (2) *fmt.wrapError (3) *fmt.wrapError (4) *fmt.wrapError (5) *errors.errorString (6) *fmt.wrapError (7) *fmt.wrapError (8) *fmt.wrapError (9) *errors.errorString` },
252
- {
253
- name : "single cause chain with multi-cause wrapper inside with single-cause chains inside" ,
254
- err : fmt .Errorf (
255
- "prefix1: %w" ,
256
- fmt .Errorf (
257
- "prefix2: %w" ,
258
- goErr .Join (
259
- fmt .Errorf ("a%w" , fmt .Errorf ("b%w" , fmt .Errorf ("c%w" , goErr .New ("d" )))),
260
- fmt .Errorf ("e%w" , fmt .Errorf ("f%w" , fmt .Errorf ("g%w" , goErr .New ("h" )))),
261
- ))),
262
- expectedSimple : `prefix1: prefix2: abcd
263
- efgh` ,
264
- expectedVerbose : `prefix1: prefix2: abcd
265
- (1) prefix1
266
- Wraps: (2) prefix2
267
- Wraps: (3) abcd
268
- | efgh
269
- └─ Wraps: (4) efgh
270
- └─ Wraps: (5) fgh
271
- └─ Wraps: (6) gh
272
- └─ Wraps: (7) h
273
- └─ Wraps: (8) abcd
274
- └─ Wraps: (9) bcd
275
- └─ Wraps: (10) cd
276
- └─ Wraps: (11) d
277
- Error types: (1) *fmt.wrapError (2) *fmt.wrapError (3) *errors.joinError (4) *fmt.wrapError (5) *fmt.wrapError (6) *fmt.wrapError (7) *errors.errorString (8) *fmt.wrapError (9) *fmt.wrapError (10) *fmt.wrapError (11) *errors.errorString` ,
278
181
},
279
182
{
280
183
name : "test wrapMini elides cause error string" ,
0 commit comments