(t *testing.T)
| 158 | } |
| 159 | |
| 160 | func TestLeakChecker_PassesOnCleanup(t *testing.T) { |
| 161 | TrackAsyncReporters() |
| 162 | defer func() { |
| 163 | internal.AsyncReporterCleanupDelegate = func(f func()) func() { return f } |
| 164 | }() |
| 165 | noOpCleanup := func() {} |
| 166 | wrappedCleanup := internal.AsyncReporterCleanupDelegate(noOpCleanup) |
| 167 | wrappedCleanup() |
| 168 | tl := &testLogger{} |
| 169 | CheckAsyncReporters(tl) |
| 170 | if tl.errorCount > 0 { |
| 171 | t.Errorf("Expected no leaks, but got errors: %v", tl.errors) |
| 172 | } |
| 173 | } |
nothing calls this directly
no test coverage detected