assertredis

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(t *testing.T, rc redis.Conn, key string, msgAndArgs ...any) bool

Exists asserts that the given key exists

func FlushDB

func FlushDB()

FlushDB flushes the test database

func Get

func Get(t *testing.T, rc redis.Conn, key string, expected string, msgAndArgs ...any) bool

Get asserts that the given key contains the given string value

func HGet added in v0.4.0

func HGet(t *testing.T, rc redis.Conn, key, field string, expected string, msgAndArgs ...any) bool

HGetAll asserts the result of calling HGET on the given key and field

func HGetAll

func HGetAll(t *testing.T, rc redis.Conn, key string, expected map[string]string, msgAndArgs ...any) bool

HGetAll asserts the result of calling HGETALL on the given key

func HLen added in v0.2.2

func HLen(t *testing.T, rc redis.Conn, key string, expected int, msgAndArgs ...any) bool

HLen asserts the result of calling HLEN on the given key

func Keys

func Keys(t *testing.T, rc redis.Conn, pattern string, expected []string, msgAndArgs ...any) bool

Keys asserts that only the given keys exist

func LGetAll added in v0.7.0

func LGetAll(t *testing.T, rc redis.Conn, key string, expected []string, msgAndArgs ...any) bool

LGetAll asserts the result of calling LRANGE <?> 0 -1 on the given key

func LLen added in v0.2.2

func LLen(t *testing.T, rc redis.Conn, key string, expected int, msgAndArgs ...any) bool

LLen asserts the result of calling LLEN on the given key

func LRange added in v0.6.2

func LRange(t *testing.T, rc redis.Conn, key string, start, stop int, expected []string, msgAndArgs ...any) bool

LRange asserts the result of calling LRANGE on the given key

func NotExists

func NotExists(t *testing.T, rc redis.Conn, key string, msgAndArgs ...any) bool

NotExists asserts that the given key does not exist

func SCard added in v0.2.0

func SCard(t *testing.T, rc redis.Conn, key string, expected int, msgAndArgs ...any) bool

SCard asserts the result of calling SCARD on the given key

func SIsMember added in v0.3.0

func SIsMember(t *testing.T, rc redis.Conn, key, member string, msgAndArgs ...any) bool

SIsMember asserts the result that calling SISMEMBER on the given key is true

func SIsNotMember added in v0.7.0

func SIsNotMember(t *testing.T, rc redis.Conn, key, member string, msgAndArgs ...any) bool

SIsNotMember asserts the result of calling SISMEMBER on the given key is false

func SMembers

func SMembers(t *testing.T, rc redis.Conn, key string, expected []string, msgAndArgs ...any) bool

SMembers asserts the result of calling SMEMBERS on the given key

func TestDB

func TestDB() *redis.Pool

TestDB returns a redis pool to our test database

func ZCard added in v0.2.0

func ZCard(t *testing.T, rc redis.Conn, key string, expected int, msgAndArgs ...any) bool

ZCard asserts the result of calling ZCARD on the given key

func ZGetAll added in v0.7.0

func ZGetAll(t *testing.T, rc redis.Conn, key string, expected map[string]float64, msgAndArgs ...any) bool

ZGetAll asserts the result of calling ZRANGE <?> 0 -1 WITHSCORES on the given key

func ZRange

func ZRange(t *testing.T, rc redis.Conn, key string, start, stop int, expected []string, msgAndArgs ...any) bool

ZRange asserts the result of calling ZRANGE on the given key

func ZScore added in v0.6.1

func ZScore(t *testing.T, rc redis.Conn, key, member string, expected float64, msgAndArgs ...any) bool

ZRange asserts the result of calling ZSCORE on the given key

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL