(t *testing.T)
| 63 | } |
| 64 | |
| 65 | func 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 | |
| 86 | func TestErrorCollectorAdd_NilError(t *testing.T) { |
| 87 | collector := NewErrorCollector(false) |
nothing calls this directly
no test coverage detected