mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Make SORT tests use both ziplists and linked lists as input
This commit is contained in:
parent
5d4f3a8c85
commit
ced6709cb9
@ -34,15 +34,23 @@ start_server {
|
|||||||
set _ $result
|
set _ $result
|
||||||
}
|
}
|
||||||
|
|
||||||
set result [create_random_dataset 16 lpush]
|
foreach {num cmd enc title} {
|
||||||
test "SORT BY key" {
|
16 lpush ziplist "Ziplist"
|
||||||
|
64 lpush linkedlist "Linked list"
|
||||||
|
} {
|
||||||
|
set result [create_random_dataset $num $cmd]
|
||||||
|
assert_encoding $enc tosort
|
||||||
|
|
||||||
|
test "$title: SORT BY key" {
|
||||||
assert_equal $result [r sort tosort {BY weight_*}]
|
assert_equal $result [r sort tosort {BY weight_*}]
|
||||||
}
|
}
|
||||||
|
|
||||||
test "SORT BY hash field" {
|
test "$title: SORT BY hash field" {
|
||||||
assert_equal $result [r sort tosort {BY wobj_*->weight}]
|
assert_equal $result [r sort tosort {BY wobj_*->weight}]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set result [create_random_dataset 16 lpush]
|
||||||
test "SORT GET #" {
|
test "SORT GET #" {
|
||||||
assert_equal [lsort -integer $result] [r sort tosort GET #]
|
assert_equal [lsort -integer $result] [r sort tosort GET #]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user