chore: add more tests (#2795)

* chore: add more tests

* chore: add more tests

* chore: add more tests

* chore: add more tests

* chore: add more tests

* chore: add more tests
This commit is contained in:
Kevin Wan
2023-01-15 21:32:41 +08:00
committed by GitHub
parent 963b52fb1b
commit 5f02e623f5
4 changed files with 210 additions and 74 deletions

View File

@@ -2278,12 +2278,25 @@ func (s *Redis) ZrangeWithScoresByFloatCtx(ctx context.Context, key string, star
}
// ZRevRangeWithScores is the implementation of redis zrevrange command with scores.
// Deprecated: use ZrevrangeWithScores instead.
func (s *Redis) ZRevRangeWithScores(key string, start, stop int64) ([]Pair, error) {
return s.ZRevRangeWithScoresCtx(context.Background(), key, start, stop)
return s.ZrevrangeWithScoresCtx(context.Background(), key, start, stop)
}
// ZrevrangeWithScores is the implementation of redis zrevrange command with scores.
func (s *Redis) ZrevrangeWithScores(key string, start, stop int64) ([]Pair, error) {
return s.ZrevrangeWithScoresCtx(context.Background(), key, start, stop)
}
// ZRevRangeWithScoresCtx is the implementation of redis zrevrange command with scores.
// Deprecated: use ZrevrangeWithScoresCtx instead.
func (s *Redis) ZRevRangeWithScoresCtx(ctx context.Context, key string, start, stop int64) (
val []Pair, err error) {
return s.ZrevrangeWithScoresCtx(ctx, key, start, stop)
}
// ZrevrangeWithScoresCtx is the implementation of redis zrevrange command with scores.
func (s *Redis) ZrevrangeWithScoresCtx(ctx context.Context, key string, start, stop int64) (
val []Pair, err error) {
err = s.brk.DoWithAcceptable(func() error {
conn, err := getRedis(s)
@@ -2304,12 +2317,25 @@ func (s *Redis) ZRevRangeWithScoresCtx(ctx context.Context, key string, start, s
}
// ZRevRangeWithScoresByFloat is the implementation of redis zrevrange command with scores by float.
// Deprecated: use ZrevrangeWithScoresByFloat instead.
func (s *Redis) ZRevRangeWithScoresByFloat(key string, start, stop int64) ([]FloatPair, error) {
return s.ZRevRangeWithScoresByFloatCtx(context.Background(), key, start, stop)
return s.ZrevrangeWithScoresByFloatCtx(context.Background(), key, start, stop)
}
// ZrevrangeWithScoresByFloat is the implementation of redis zrevrange command with scores by float.
func (s *Redis) ZrevrangeWithScoresByFloat(key string, start, stop int64) ([]FloatPair, error) {
return s.ZrevrangeWithScoresByFloatCtx(context.Background(), key, start, stop)
}
// ZRevRangeWithScoresByFloatCtx is the implementation of redis zrevrange command with scores by float.
// Deprecated: use ZrevrangeWithScoresByFloatCtx instead.
func (s *Redis) ZRevRangeWithScoresByFloatCtx(ctx context.Context, key string, start, stop int64) (
val []FloatPair, err error) {
return s.ZrevrangeWithScoresByFloatCtx(ctx, key, start, stop)
}
// ZrevrangeWithScoresByFloatCtx is the implementation of redis zrevrange command with scores by float.
func (s *Redis) ZrevrangeWithScoresByFloatCtx(ctx context.Context, key string, start, stop int64) (
val []FloatPair, err error) {
err = s.brk.DoWithAcceptable(func() error {
conn, err := getRedis(s)