summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-03-23 15:22:25 +0100
committerantirez <antirez@gmail.com>2012-03-23 20:24:30 +0100
commit03116904c399cf21db3fe4228af3a795ce20fc46 (patch)
tree5c0a038803e288aea996d2861c29879c083467f7
parentbd376d13f820b168954ac6683b5197a4ed72f03b (diff)
downloadredis-03116904c399cf21db3fe4228af3a795ce20fc46.tar.gz
RDB load of different encodings test added.
-rw-r--r--tests/assets/encodings.rdbbin0 -> 667 bytes
-rw-r--r--tests/integration/rdb.tcl25
-rw-r--r--tests/test_helper.tcl1
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/assets/encodings.rdb b/tests/assets/encodings.rdb
new file mode 100644
index 000000000..9fd9b705d
--- /dev/null
+++ b/tests/assets/encodings.rdb
Binary files differ
diff --git a/tests/integration/rdb.tcl b/tests/integration/rdb.tcl
new file mode 100644
index 000000000..fdc5495f7
--- /dev/null
+++ b/tests/integration/rdb.tcl
@@ -0,0 +1,25 @@
+set server_path [tmpdir "server.rdb-encoding-test"]
+
+# Copy RDB with zipmap encoded hash to server path
+exec cp tests/assets/encodings.rdb $server_path
+
+start_server [list overrides [list "dir" $server_path "dbfilename" "encodings.rdb"]] {
+ test "RDB encoding loading test" {
+ r select 0
+ csvdump r
+ } {"compressible","string","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"hash","hash","a","1","aa","10","aaa","100","b","2","bb","20","bbb","200","c","3","cc","30","ccc","300","ddd","400","eee","5000000000",
+"hash_zipped","hash","a","1","b","2","c","3",
+"list","list","1","2","3","a","b","c","100000","6000000000","1","2","3","a","b","c","100000","6000000000","1","2","3","a","b","c","100000","6000000000",
+"list_zipped","list","1","2","3","a","b","c","100000","6000000000",
+"number","string","10"
+"set","set","1","100000","2","3","6000000000","a","b","c",
+"set_zipped_1","set","1","2","3","4",
+"set_zipped_2","set","100000","200000","300000","400000",
+"set_zipped_3","set","1000000000","2000000000","3000000000","4000000000","5000000000","6000000000",
+"string","string","Hello World"
+"zset","zset","a","1","b","2","c","3","aa","10","bb","20","cc","30","aaa","100","bbb","200","ccc","300","aaaa","1000","cccc","123456789","bbbb","5000000000",
+"zset_zipped","zset","a","1","b","2","c","3",
+}
+}
+
diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
index ef128ae20..4954b79e5 100644
--- a/tests/test_helper.tcl
+++ b/tests/test_helper.tcl
@@ -30,6 +30,7 @@ set ::all_tests {
integration/replication-2
integration/replication-3
integration/aof
+ integration/rdb
unit/pubsub
unit/slowlog
unit/scripting