callsCountFunction returns a function that increments the int that callCounter points to whenever it is run.
(callCounter *int)
| 26 | // callsCountFunction returns a function that increments the int that |
| 27 | // callCounter points to whenever it is run. |
| 28 | func callsCountFunction(callCounter *int) Effector { |
| 29 | return func(ctx context.Context) (string, error) { |
| 30 | *callCounter++ |
| 31 | return fmt.Sprintf("call %d", *callCounter), nil |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // TestThrottleMax1 tests whether a max of 1 call per duration is respected. |
| 36 | func TestThrottleMax1(t *testing.T) { |
no outgoing calls
no test coverage detected