MCPcopy Create free account
hub / github.com/github/gh-aw / TestErrorCollectorAdd_Aggregate

Function TestErrorCollectorAdd_Aggregate

pkg/workflow/error_aggregation_test.go:65–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestErrorCollectorAdd_Aggregate(t *testing.T) {
66 collector := NewErrorCollector(false)
67 err1 := errors.New("first error")
68 err2 := errors.New("second error")
69 err3 := errors.New("third error")
70
71 // Add errors should not return them
72 result := collector.Add(err1)
73 require.NoError(t, result, "Should not return error in aggregate mode")
74 assert.Positive(t, collector.Count(), "Should have errors")
75 assert.Equal(t, 1, collector.Count(), "Should have 1 error")
76
77 result = collector.Add(err2)
78 require.NoError(t, result, "Should not return error in aggregate mode")
79 assert.Equal(t, 2, collector.Count(), "Should have 2 errors")
80
81 result = collector.Add(err3)
82 require.NoError(t, result, "Should not return error in aggregate mode")
83 assert.Equal(t, 3, collector.Count(), "Should have 3 errors")
84}
85
86func TestErrorCollectorAdd_NilError(t *testing.T) {
87 collector := NewErrorCollector(false)

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
CountMethod · 0.95
NewErrorCollectorFunction · 0.85

Tested by

no test coverage detected