MCPcopy
hub / github.com/mochi-mqtt/server / TestHooksStop

Function TestHooksStop

hooks_test.go:216–226  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

214}
215
216func TestHooksStop(t *testing.T) {
217 h := new(Hooks)
218 h.Log = logger
219
220 err := h.Add(new(HookBase), nil)
221 require.NoError(t, err)
222 require.Equal(t, int64(1), atomic.LoadInt64(&h.qty))
223 require.Equal(t, int64(1), h.Len())
224
225 h.Stop()
226}
227
228// coverage: also cover some empty functions
229func TestHooksNonReturns(t *testing.T) {

Callers

nothing calls this directly

Calls 3

StopMethod · 0.65
AddMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected