MCPcopy
hub / github.com/zeromicro/go-zero / TestBatchErrorWithErrors

Function TestBatchErrorWithErrors

core/errorx/batcherror_test.go:42–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestBatchErrorWithErrors(t *testing.T) {
43 var batch BatchError
44 batch.Add(errors.New(err1))
45 batch.Add(errors.New(err2))
46 assert.NotNil(t, batch.Err())
47 assert.Equal(t, fmt.Sprintf("%s\n%s", err1, err2), batch.Err().Error())
48 assert.True(t, batch.NotNil())
49}
50
51func TestBatchErrorConcurrentAdd(t *testing.T) {
52 const count = 10000

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
NotNilMethod · 0.95
ErrMethod · 0.95
TrueMethod · 0.80
EqualMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…