1
0
mirror of https://github.com/fluencelabs/redis synced 2025-06-12 00:31:21 +00:00
Files
deps
src
tests
assets
helpers
integration
aof-race.tcl
aof.tcl
convert-zipmap-hash-on-load.tcl
rdb.tcl
redis-cli.tcl
replication-2.tcl
replication-3.tcl
replication-4.tcl
replication.tcl
support
tmp
unit
test_helper.tcl
utils
.gitignore
00-RELEASENOTES
BUGS
CONTRIBUTING
COPYING
Changelog
INSTALL
MANIFESTO
Makefile
README
TODO
redis.conf
runtest
redis/tests/integration/convert-zipmap-hash-on-load.tcl

36 lines
1.3 KiB
Tcl
Raw Normal View History

# Copy RDB with zipmap encoded hash to server path
set server_path [tmpdir "server.convert-zipmap-hash-on-load"]
exec cp -f tests/assets/hash-zipmap.rdb $server_path
start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb"]] {
test "RDB load zipmap hash: converts to ziplist" {
r select 0
assert_match "*ziplist*" [r debug object hash]
assert_equal 2 [r hlen hash]
assert_match {v1 v2} [r hmget hash f1 f2]
}
}
exec cp -f tests/assets/hash-zipmap.rdb $server_path
start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb" "hash-max-ziplist-entries" 1]] {
test "RDB load zipmap hash: converts to hash table when hash-max-ziplist-entries is exceeded" {
r select 0
assert_match "*hashtable*" [r debug object hash]
assert_equal 2 [r hlen hash]
assert_match {v1 v2} [r hmget hash f1 f2]
}
}
exec cp -f tests/assets/hash-zipmap.rdb $server_path
start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb" "hash-max-ziplist-value" 1]] {
test "RDB load zipmap hash: converts to hash table when hash-max-ziplist-value is exceeded" {
r select 0
assert_match "*hashtable*" [r debug object hash]
assert_equal 2 [r hlen hash]
assert_match {v1 v2} [r hmget hash f1 f2]
}
}