summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-09-15 09:37:30 +0200
committerantirez <antirez@gmail.com>2015-09-15 09:37:30 +0200
commit846da5b22e7877614694b4bda94fe0fdca34ada9 (patch)
tree36feedc25c758796c754d481499e616761e147c9 /tests/unit
parent3c23b5ffd0d7dd01df79154c1701d4d3ded7bf66 (diff)
downloadredis-846da5b22e7877614694b4bda94fe0fdca34ada9.tar.gz
Test: fix false positive in HSTRLEN test.
HINCRBY* tests later used the value "tmp" that was sometimes generated by the random key generation function. The result was ovewriting what Tcl expected to be inside Redis with another value, causing the next HSTRLEN test to fail.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/type/hash.tcl10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/type/hash.tcl b/tests/unit/type/hash.tcl
index 5381b0e33..0ddc22b90 100644
--- a/tests/unit/type/hash.tcl
+++ b/tests/unit/type/hash.tcl
@@ -2,8 +2,8 @@ start_server {tags {"hash"}} {
test {HSET/HLEN - Small hash creation} {
array set smallhash {}
for {set i 0} {$i < 8} {incr i} {
- set key [randstring 0 8 alpha]
- set val [randstring 0 8 alpha]
+ set key __avoid_collisions__[randstring 0 8 alpha]
+ set val __avoid_collisions__[randstring 0 8 alpha]
if {[info exists smallhash($key)]} {
incr i -1
continue
@@ -21,8 +21,8 @@ start_server {tags {"hash"}} {
test {HSET/HLEN - Big hash creation} {
array set bighash {}
for {set i 0} {$i < 1024} {incr i} {
- set key [randstring 0 8 alpha]
- set val [randstring 0 8 alpha]
+ set key __avoid_collisions__[randstring 0 8 alpha]
+ set val __avoid_collisions__[randstring 0 8 alpha]
if {[info exists bighash($key)]} {
incr i -1
continue
@@ -33,7 +33,7 @@ start_server {tags {"hash"}} {
list [r hlen bighash]
} {1024}
- test {Is the big hash encoded with a ziplist?} {
+ test {Is the big hash encoded with an hash table?} {
assert_encoding hashtable bighash
}