Skip to content

Commit bdefae8

Browse files
committed
test only for 8.4
1 parent 9131fcb commit bdefae8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

digest_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ import (
77
"github.com/redis/go-redis/v9"
88
)
99

10+
// skipIfRedisBelow84 checks if Redis version is below 8.4 and skips the test if so
11+
func skipIfRedisBelow84(t *testing.T) {
12+
if RedisVersion < 8.4 {
13+
t.Skipf("Skipping test: Redis version %.1f < 8.4 (DIGEST command requires Redis 8.4+)", RedisVersion)
14+
}
15+
}
16+
1017
// TestDigestBasic validates that the Digest command returns a uint64 value
1118
func TestDigestBasic(t *testing.T) {
19+
skipIfRedisBelow84(t)
20+
1221
ctx := context.Background()
1322
client := redis.NewClient(&redis.Options{
1423
Addr: "localhost:6379",
@@ -51,6 +60,8 @@ func TestDigestBasic(t *testing.T) {
5160

5261
// TestSetIFDEQWithDigest validates the SetIFDEQ command works with digests
5362
func TestSetIFDEQWithDigest(t *testing.T) {
63+
skipIfRedisBelow84(t)
64+
5465
ctx := context.Background()
5566
client := redis.NewClient(&redis.Options{
5667
Addr: "localhost:6379",
@@ -113,6 +124,8 @@ func TestSetIFDEQWithDigest(t *testing.T) {
113124

114125
// TestSetIFDNEWithDigest validates the SetIFDNE command works with digests
115126
func TestSetIFDNEWithDigest(t *testing.T) {
127+
skipIfRedisBelow84(t)
128+
116129
ctx := context.Background()
117130
client := redis.NewClient(&redis.Options{
118131
Addr: "localhost:6379",
@@ -175,6 +188,8 @@ func TestSetIFDNEWithDigest(t *testing.T) {
175188

176189
// TestDelExArgsWithDigest validates DelExArgs works with digest matching
177190
func TestDelExArgsWithDigest(t *testing.T) {
191+
skipIfRedisBelow84(t)
192+
178193
ctx := context.Background()
179194
client := redis.NewClient(&redis.Options{
180195
Addr: "localhost:6379",

0 commit comments

Comments
 (0)