mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
test-redis.tcl dataset digest function Hash support
This commit is contained in:
parent
ad6de43c80
commit
12f72a714c
@ -152,7 +152,6 @@ proc createComplexDataset {r ops} {
|
||||
} {
|
||||
$r zadd $k $d $v
|
||||
} {
|
||||
puts "hset $k $f $v"
|
||||
$r hset $k $f $v
|
||||
}
|
||||
set t [$r type $k]
|
||||
@ -179,7 +178,7 @@ proc createComplexDataset {r ops} {
|
||||
}
|
||||
{hash} {
|
||||
randpath {$r hset $k $f $v} \
|
||||
{puts "$r hdel $k $f"; $r hdel $k $f}
|
||||
{$r hdel $k $f}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -211,6 +210,12 @@ proc datasetDigest r {
|
||||
} else {
|
||||
set aux [::sha1::sha1 -hex [$r zrange $k 0 -1]]
|
||||
}
|
||||
} {hash} {
|
||||
if {[$r hlen $k] == 0} {
|
||||
set aux {}
|
||||
} else {
|
||||
set aux [::sha1::sha1 -hex [lsort [$r hgetall $k]]]
|
||||
}
|
||||
} default {
|
||||
error "Type not supported: $t"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user