From 12f72a714c6266269b7c9066b7e1349c7682a8e7 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 18 Mar 2010 03:27:08 +0100 Subject: [PATCH] test-redis.tcl dataset digest function Hash support --- test-redis.tcl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test-redis.tcl b/test-redis.tcl index acb1aced..c8cb3019 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -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" } -- 2.45.2