diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:40:55 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:40:55 +0100 |
| commit | 5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda (patch) | |
| tree | 1acdfa5220cd13b7be43a2a01368e80d306473ca /examples/redis-unstable/tests/integration/convert-ziplist-zset-on-load.tcl | |
| parent | c7ab12bba64d9c20ccd79b132dac475f7bc3923e (diff) | |
| download | crep-5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda.tar.gz | |
Add Redis source code for testing
Diffstat (limited to 'examples/redis-unstable/tests/integration/convert-ziplist-zset-on-load.tcl')
| -rw-r--r-- | examples/redis-unstable/tests/integration/convert-ziplist-zset-on-load.tcl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/redis-unstable/tests/integration/convert-ziplist-zset-on-load.tcl b/examples/redis-unstable/tests/integration/convert-ziplist-zset-on-load.tcl new file mode 100644 index 0000000..0fbb201 --- /dev/null +++ b/examples/redis-unstable/tests/integration/convert-ziplist-zset-on-load.tcl | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | tags {"external:skip"} { | ||
| 2 | |||
| 3 | # Copy RDB with ziplist encoded hash to server path | ||
| 4 | set server_path [tmpdir "server.convert-ziplist-hash-on-load"] | ||
| 5 | |||
| 6 | exec cp -f tests/assets/zset-ziplist.rdb $server_path | ||
| 7 | start_server [list overrides [list "dir" $server_path "dbfilename" "zset-ziplist.rdb"]] { | ||
| 8 | test "RDB load ziplist zset: converts to listpack when RDB loading" { | ||
| 9 | r select 0 | ||
| 10 | |||
| 11 | assert_encoding listpack zset | ||
| 12 | assert_equal 2 [r zcard zset] | ||
| 13 | assert_match {one 1 two 2} [r zrange zset 0 -1 withscores] | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | exec cp -f tests/assets/zset-ziplist.rdb $server_path | ||
| 18 | start_server [list overrides [list "dir" $server_path "dbfilename" "zset-ziplist.rdb" "zset-max-ziplist-entries" 1]] { | ||
| 19 | test "RDB load ziplist zset: converts to skiplist when zset-max-ziplist-entries is exceeded" { | ||
| 20 | r select 0 | ||
| 21 | |||
| 22 | assert_encoding skiplist zset | ||
| 23 | assert_equal 2 [r zcard zset] | ||
| 24 | assert_match {one 1 two 2} [r zrange zset 0 -1 withscores] | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | } | ||
