(b *testing.B)
| 162 | } |
| 163 | |
| 164 | func BenchmarkContextWatcherCancelled(b *testing.B) { |
| 165 | cw := ctxwatch.NewContextWatcher(&testHandler{handleCancel: func(context.Context) {}, handleUnwatchAfterCancel: func() {}}) |
| 166 | |
| 167 | for b.Loop() { |
| 168 | ctx, cancel := context.WithCancel(context.Background()) |
| 169 | cw.Watch(ctx) |
| 170 | cancel() |
| 171 | cw.Unwatch() |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | func BenchmarkContextWatcherCancellable(b *testing.B) { |
| 176 | cw := ctxwatch.NewContextWatcher(&testHandler{handleCancel: func(context.Context) {}, handleUnwatchAfterCancel: func() {}}) |
nothing calls this directly
no test coverage detected