(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestOutputLimiter(t *testing.T) { |
| 11 | wg := new(sync.WaitGroup) |
| 12 | |
| 13 | input := NewTestInput() |
| 14 | output := NewLimiter(NewTestOutput(func(*Message) { |
| 15 | wg.Done() |
| 16 | }), "10") |
| 17 | wg.Add(10) |
| 18 | |
| 19 | plugins := &InOutPlugins{ |
| 20 | Inputs: []PluginReader{input}, |
| 21 | Outputs: []PluginWriter{output}, |
| 22 | } |
| 23 | plugins.All = append(plugins.All, input, output) |
| 24 | |
| 25 | emitter := NewEmitter() |
| 26 | go emitter.Start(plugins, Settings.Middleware) |
| 27 | |
| 28 | for i := 0; i < 100; i++ { |
| 29 | input.EmitGET() |
| 30 | } |
| 31 | |
| 32 | wg.Wait() |
| 33 | emitter.Close() |
| 34 | } |
| 35 | |
| 36 | func TestInputLimiter(t *testing.T) { |
| 37 | wg := new(sync.WaitGroup) |
nothing calls this directly
no test coverage detected