mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
use DEBUG DIGEST in the test instead of a function that was doing a similar work, but in a much slower and buggy way
This commit is contained in:
parent
a57d9cc437
commit
758b6d4c27
@ -191,45 +191,7 @@ proc createComplexDataset {r ops} {
|
||||
}
|
||||
|
||||
proc datasetDigest r {
|
||||
set keys [lsort [$r keys *]]
|
||||
set digest {}
|
||||
foreach k $keys {
|
||||
set t [$r type $k]
|
||||
switch $t {
|
||||
{string} {
|
||||
set aux [::sha1::sha1 -hex [$r get $k]]
|
||||
} {list} {
|
||||
if {[$r llen $k] == 0} {
|
||||
set aux {}
|
||||
} else {
|
||||
set aux [::sha1::sha1 -hex [$r lrange $k 0 -1]]
|
||||
}
|
||||
} {set} {
|
||||
if {[$r scard $k] == 0} {
|
||||
set aux {}
|
||||
} else {
|
||||
set aux [::sha1::sha1 -hex [lsort [$r smembers $k]]]
|
||||
}
|
||||
} {zset} {
|
||||
if {[$r zcard $k] == 0} {
|
||||
set aux {}
|
||||
} else {
|
||||
set aux [::sha1::sha1 -hex [$r zrange $k 0 -1 withscores]]
|
||||
}
|
||||
} {hash} {
|
||||
if {[$r hlen $k] == 0} {
|
||||
set aux {}
|
||||
} else {
|
||||
set aux [::sha1::sha1 -hex [lsort [$r hgetall $k]]]
|
||||
}
|
||||
} default {
|
||||
error "Type not supported: $t"
|
||||
}
|
||||
}
|
||||
if {$aux eq {}} continue
|
||||
set digest [::sha1::sha1 -hex [join [list $aux $digest $k] "\n"]]
|
||||
}
|
||||
return $digest
|
||||
$r debug digest
|
||||
}
|
||||
|
||||
proc main {} {
|
||||
|
Loading…
x
Reference in New Issue
Block a user