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
f5799e72
Commit
f5799e72
authored
Feb 16, 2018
by
antirez
Browse files
CG: test XPENDING ability to return pending items.
parent
c2ecac47
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/type/stream-cgroups.tcl
View file @
f5799e72
...
@@ -38,4 +38,24 @@ start_server {
...
@@ -38,4 +38,24 @@ start_server {
assert
{[
lindex $r1 0 1 0 1
]
eq
{
a 1
}}
assert
{[
lindex $r1 0 1 0 1
]
eq
{
a 1
}}
assert
{[
lindex $r2 0 1 0 1
]
eq
{
c 3
}}
assert
{[
lindex $r2 0 1 0 1
]
eq
{
c 3
}}
}
}
test
{
XPENDING is able to return pending items
}
{
set pending
[
r XPENDING mystream mygroup - + 10
]
assert
{[
llength $pending
]
== 4
}
for
{
set j 0
}
{
$j
< 4
}
{
incr j
}
{
set item
[
lindex $pending $j
]
if
{
$j
< 2
}
{
set owner client-1
}
else
{
set owner client-2
}
assert
{[
lindex $item 1
]
eq $owner
}
assert
{[
lindex $item 1
]
eq $owner
}
}
}
test
{
XPENDING can return single consumer items
}
{
set pending
[
r XPENDING mystream mygroup - + 10 client-1
]
assert
{[
llength $pending
]
== 2
}
}
}
}
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