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
a6e312bf
Commit
a6e312bf
authored
Oct 10, 2011
by
antirez
Browse files
Added two new tests for RENAME, currently both will fail because of bug #128.
parent
0e841b99
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/basic.tcl
View file @
a6e312bf
...
@@ -262,6 +262,25 @@ start_server {tags {"basic"}} {
...
@@ -262,6 +262,25 @@ start_server {tags {"basic"}} {
format $err
format $err
}
{
ERR*
}
}
{
ERR*
}
test
{
RENAME with volatile key, should move the TTL as well
}
{
r del mykey mykey2
r set mykey foo
r expire mykey 100
assert
{[
r ttl mykey
]
> 95 &&
[
r ttl mykey
]
<= 100
}
r rename mykey mykey2
assert
{[
r ttl mykey2
]
> 95 &&
[
r ttl mykey2
]
<= 100
}
}
test
{
RENAME with volatile key, should not inherit TTL of target key
}
{
r del mykey mykey2
r set mykey foo
r set mykey2 bar
r expire mykey2 100
assert
{[
r ttl mykey
]
== -1 &&
[
r ttl mykey2
]
> 0
}
r rename mykey mykey2
r ttl mykey2
}
{
-1
}
test
{
DEL all keys again
(
DB 0
)}
{
test
{
DEL all keys again
(
DB 0
)}
{
foreach key
[
r keys *
]
{
foreach key
[
r keys *
]
{
r del $key
r del $key
...
...
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