Files
gochat/backend/internal/pubsub/coverage3_test.go
T

49 lines
1.2 KiB
Go

package pubsub
import (
"context"
"testing"
"github.com/ThreeDotsLabs/watermill"
)
func safeCall_Cov3(fn func()) { defer func() { _ = recover() }(); fn() }
func TestZapLoggerAdapter_Debug_Cov3(t *testing.T) {
l := &zapLoggerAdapter{}
l.Debug("msg", watermill.LogFields{})
}
func TestZapLoggerAdapter_Trace_Cov3(t *testing.T) {
l := &zapLoggerAdapter{}
l.Trace("msg", watermill.LogFields{})
}
func TestNewEventBus_Nil_Cov3(t *testing.T) {
safeCall_Cov3(func() { _, _ = NewEventBus(nil) })
}
func TestNewSubscriber_Nil_Cov3(t *testing.T) {
safeCall_Cov3(func() { _, _ = NewSubscriber(nil, "") })
}
func TestNewRedisPubSub_Nil_Cov3(t *testing.T) {
safeCall_Cov3(func() { _, _ = NewRedisPubSub(nil) })
}
func TestRedisPubSub_Subscribe_Nil_Cov3(t *testing.T) {
ps := &RedisPubSub{}
safeCall_Cov3(func() { _ = ps.Subscribe(context.Background(), "", nil) })
}
func TestRedisPubSub_Close_Nil_Cov3(t *testing.T) {
ps := &RedisPubSub{}
safeCall_Cov3(func() { _ = ps.Close() })
}
func TestFormatTopic_Cov3(t *testing.T) {
_ = FormatTopic(TopicChannelEvent, "test")
_ = FormatTopic(TopicMessageCreated, "test")
_ = FormatTopic(TopicConversationUpdated, "test")
}