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
e53c9030
Commit
e53c9030
authored
Sep 29, 2017
by
antirez
Browse files
Streams: add XADD + MAXLEN test.
parent
0248a6b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/type/stream.tcl
View file @
e53c9030
...
...
@@ -79,6 +79,23 @@ start_server {
assert
{[
streamCompareID $id2 $id3
]
== -1
}
}
test
{
XADD with MAXLEN option
}
{
r DEL mystream
for
{
set j 0
}
{
$j
< 1000
}
{
incr j
}
{
if
{
rand
()
< 0.9
}
{
r XADD mystream MAXLEN 5 * xitem $j
}
else
{
r XADD mystream MAXLEN 5 * yitem $j
}
}
set res
[
r xrange mystream - +
]
set expected 995
foreach r $res
{
assert
{[
lindex $r 1 1
]
== $expected
}
incr expected
}
}
test
{
XADD mass insertion and XLEN
}
{
r DEL mystream
r multi
...
...
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