assertredis

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(t *testing.T, rp *redis.Pool, 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, rp *redis.Pool, 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, rp *redis.Pool, 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, rp *redis.Pool, 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, rp *redis.Pool, 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, rp *redis.Pool, pattern string, expected []string, msgAndArgs ...any) bool

Keys asserts that only the given keys exist

func LLen added in v0.2.2

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

LLen asserts the result of calling LLEN on the given key

func NotExists

func NotExists(t *testing.T, rp *redis.Pool, 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, rp *redis.Pool, 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, rp *redis.Pool, key, member string, expected bool, msgAndArgs ...any) bool

SIsMember asserts the result of calling SISMEMBER on the given key

func SMembers

func SMembers(t *testing.T, rp *redis.Pool, 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, rp *redis.Pool, key string, expected int, msgAndArgs ...any) bool

ZCard asserts the result of calling ZCARD on the given key

func ZRange

func ZRange(t *testing.T, rp *redis.Pool, key string, min, max int, expected []string, msgAndArgs ...any) bool

ZRange asserts the result of calling ZRANGE 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