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
ea1f503c
Commit
ea1f503c
authored
Jan 14, 2013
by
antirez
Browse files
Tests for CLIENT GETNAME/SETNAME.
parent
9b89ab06
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/introspection.tcl
View file @
ea1f503c
...
...
@@ -19,4 +19,37 @@ start_server {tags {"introspection"}} {
assert_match
{
*eval*
}
[
$rd
read
]
assert_match
{
*lua*
"set"
*
"foo"
*
"bar"
*
}
[
$rd
read
]
}
test
{
CLIENT GETNAME should return NIL if name is not assigned
}
{
r client getname
}
{}
test
{
CLIENT LIST shows empty fields for unassigned names
}
{
r client list
}
{
*name= *
}
test
{
CLIENT SETNAME does not accept spaces
}
{
catch
{
r client setname
"foo bar"
}
e
set e
}
{
ERR*
}
test
{
CLIENT SETNAME can assign a name to this connection
}
{
assert_equal
[
r client setname myname
]
{
OK
}
r client list
}
{
*name=myname*
}
test
{
CLIENT SETNAME can change the name of an existing connection
}
{
assert_equal
[
r client setname someothername
]
{
OK
}
r client list
}
{
*name=someothername*
}
test
{
After CLIENT SETNAME, connection can still be closed
}
{
set rd
[
redis_deferring_client
]
$rd client setname foobar
assert_equal
[
$rd
read
]
"OK"
assert_match
{
*foobar*
}
[
r client list
]
$rd close
# Now the client should no longer be listed
string match
{
*foobar*
}
[
r client list
]
}
{
0
}
}
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