Documentation ¶
Overview ¶
Package testutil contains helper functions for unit tests.
Index ¶
- func AssertProtoJSONEqual(t *testing.T, expected string, protoMsg interface{}, msgAndArgs ...interface{}) bool
- func ModRoot() string
- func RedisTLSConfig() *tls.Config
- func TestDataRoot() string
- func WithTestRedis(useTLS bool, handler func(rawURL string) error) error
- func WithTestRedisCluster(handler func(rawURL string) error) error
- func WithTestRedisSentinel(handler func(rawURL string) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertProtoJSONEqual ¶ added in v0.9.0
func AssertProtoJSONEqual(t *testing.T, expected string, protoMsg interface{}, msgAndArgs ...interface{}) bool
AssertProtoJSONEqual asserts that a protobuf message matches the given JSON. The protoMsg can also be a slice of protobuf messages.
func ModRoot ¶ added in v0.14.0
func ModRoot() string
ModRoot returns the directory containing the go.mod file.
func RedisTLSConfig ¶ added in v0.14.0
RedisTLSConfig returns the TLS Config to use with redis.
func TestDataRoot ¶ added in v0.14.0
func TestDataRoot() string
TestDataRoot returns the testdata directory.
func WithTestRedis ¶ added in v0.14.0
WithTestRedis creates a test a test redis instance using docker.
func WithTestRedisCluster ¶ added in v0.14.0
WithTestRedisCluster creates a new redis cluster 3 node cluster.
func WithTestRedisSentinel ¶ added in v0.14.0
WithTestRedisSentinel creates a new redis sentinel 3 node cluster.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.