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

Function TestHooksOnSelectSubscribers

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

Source from the content-addressed store, hash-verified

303}
304
305func TestHooksOnSelectSubscribers(t *testing.T) {
306 h := new(Hooks)
307 err := h.Add(new(modifiedHookBase), nil)
308 require.NoError(t, err)
309
310 subs := &Subscribers{
311 Subscriptions: map[string]packets.Subscription{
312 "cl1": {Filter: "a/b/c"},
313 },
314 }
315
316 subs2 := h.OnSelectSubscribers(subs, packets.Packet{})
317 require.EqualValues(t, subs, subs2)
318}
319
320func TestHooksOnUnsubscribe(t *testing.T) {
321 h := new(Hooks)

Callers

nothing calls this directly

Calls 2

OnSelectSubscribersMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected