assertvk

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(t *testing.T, vc valkey.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, vc valkey.Conn, key string, expected string, msgAndArgs ...any) bool

Get asserts that the given key contains the given string value

func HGet

func HGet(t *testing.T, vc valkey.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, vc valkey.Conn, key string, expected map[string]string, msgAndArgs ...any) bool

HGetAll asserts the result of calling HGETALL on the given key

func HLen

func HLen(t *testing.T, vc valkey.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, vc valkey.Conn, pattern string, expected []string, msgAndArgs ...any) bool

Keys asserts that only the given keys exist

func LGetAll

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

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

func LLen

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

LLen asserts the result of calling LLEN on the given key

func LRange

func LRange(t *testing.T, vc valkey.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, vc valkey.Conn, key string, msgAndArgs ...any) bool

NotExists asserts that the given key does not exist

func SCard

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

SCard asserts the result of calling SCARD on the given key

func SIsMember

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

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

func SIsNotMember

func SIsNotMember(t *testing.T, vc valkey.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, vc valkey.Conn, key string, expected []string, msgAndArgs ...any) bool

SMembers asserts the result of calling SMEMBERS on the given key

func TestDB

func TestDB() *valkey.Pool

TestDB returns a valkey pool to our test database

func ZCard

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

ZCard asserts the result of calling ZCARD on the given key

func ZGetAll

func ZGetAll(t *testing.T, vc valkey.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, vc valkey.Conn, key string, start, stop int, expected []string, msgAndArgs ...any) bool

ZRange asserts the result of calling ZRANGE on the given key

func ZScore

func ZScore(t *testing.T, vc valkey.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