Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ced6709c
Commit
ced6709c
authored
Aug 21, 2010
by
Pieter Noordhuis
Browse files
Make SORT tests use both ziplists and linked lists as input
parent
5d4f3a8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/sort.tcl
View file @
ced6709c
...
...
@@ -34,15 +34,23 @@ start_server {
set _ $result
}
set result
[
create_random_dataset 16 lpush
]
test
"SORT BY key"
{
assert_equal $result
[
r sort tosort
{
BY weight_*
}]
}
foreach
{
num cmd enc title
}
{
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_*
}]
}
test
"SORT BY hash field"
{
assert_equal $result
[
r sort tosort
{
BY wobj_*->weight
}]
test
"
$title:
SORT BY hash field"
{
assert_equal $result
[
r sort tosort
{
BY wobj_*->weight
}]
}
}
set result
[
create_random_dataset 16 lpush
]
test
"SORT GET #"
{
assert_equal
[
lsort -integer $result
]
[
r sort tosort GET #
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment