Files
gochat/backend/internal/wsevent/coverage2_test.go
T

34 lines
752 B
Go

package wsevent
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBridgeListener_Name_Cov2(t *testing.T) {
l := New(nil)
assert.NotEmpty(t, l.Name())
}
func TestCopyEventData_Cov2(t *testing.T) {
original := map[string]interface{}{"key": "value", "num": 42}
copied := copyEventData(original)
assert.Equal(t, "value", copied["key"])
assert.Equal(t, 42, copied["num"])
// Modify copy - original should be unchanged
copied["key"] = "modified"
assert.Equal(t, "value", original["key"])
}
func TestCopyEventData_Empty_Cov2(t *testing.T) {
copied := copyEventData(map[string]interface{}{})
assert.Empty(t, copied)
}
func TestCopyEventData_Nil_Cov2(t *testing.T) {
copied := copyEventData(nil)
assert.Empty(t, copied)
}