Files
livekit/pkg/service/utils_test.go
David Zhao ea12e1477f Update to go-redis v9. Fixed Redis cluster support (#1415)
* Update to go-redis v9. Fixed Redis cluster support
2023-02-12 22:22:21 -08:00

30 lines
579 B
Go

package service_test
import (
"testing"
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/require"
"github.com/livekit/livekit-server/pkg/service"
)
func redisClient() *redis.Client {
return redis.NewClient(&redis.Options{
Addr: "localhost:6379",
})
}
func TestIsValidDomain(t *testing.T) {
list := map[string]bool{
"turn.myhost.com": true,
"turn.google.com": true,
"https://host.com": false,
"turn://host.com": false,
}
for key, result := range list {
service.IsValidDomain(key)
require.Equal(t, service.IsValidDomain(key), result)
}
}