Skip to content

Commit

Permalink
Rename test.
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Tianjie <[email protected]>
  • Loading branch information
CharlesChen888 committed Apr 18, 2024
1 parent 94da8db commit eb665ca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/introspection.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ start_server {tags {"introspection"}} {

test {CLIENT LIST} {
r client list
} {id=* addr=*:* laddr=*:* fd=* name=* age=* idle=* flags=N db=* sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=26 qbuf-free=* argv-mem=* multi-mem=0 rbs=* rbp=* obl=0 oll=0 omem=0 tot-mem=* events=r cmd=client|list user=* redir=-1 resp=* lib-name=* lib-ver=* tot-input=* tot-output=* tot-cmds=*}
} {id=* addr=*:* laddr=*:* fd=* name=* age=* idle=* flags=N db=* sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=26 qbuf-free=* argv-mem=* multi-mem=0 rbs=* rbp=* obl=0 oll=0 omem=0 tot-mem=* events=r cmd=client|list user=* redir=-1 resp=* lib-name=* lib-ver=* tot-net-in=* tot-net-out=* tot-cmds=*}

test {CLIENT LIST with IDs} {
set myid [r client id]
Expand All @@ -17,7 +17,7 @@ start_server {tags {"introspection"}} {

test {CLIENT INFO} {
r client info
} {id=* addr=*:* laddr=*:* fd=* name=* age=* idle=* flags=N db=* sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=26 qbuf-free=* argv-mem=* multi-mem=0 rbs=* rbp=* obl=0 oll=0 omem=0 tot-mem=* events=r cmd=client|info user=* redir=-1 resp=* lib-name=* lib-ver=* tot-input=* tot-output=* tot-cmds=*}
} {id=* addr=*:* laddr=*:* fd=* name=* age=* idle=* flags=N db=* sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=26 qbuf-free=* argv-mem=* multi-mem=0 rbs=* rbp=* obl=0 oll=0 omem=0 tot-mem=* events=r cmd=client|info user=* redir=-1 resp=* lib-name=* lib-ver=* tot-net-in=* tot-net-out=* tot-cmds=*}

proc get_field_in_client_info {info field} {
set info [string trim $info]
Expand All @@ -33,12 +33,12 @@ start_server {tags {"introspection"}} {

test {client input output and command process statistics} {
set info1 [r client info]
set input1 [get_field_in_client_info $info1 "tot-input"]
set output1 [get_field_in_client_info $info1 "tot-output"]
set input1 [get_field_in_client_info $info1 "tot-net-in"]
set output1 [get_field_in_client_info $info1 "tot-net-out"]
set cmd1 [get_field_in_client_info $info1 "tot-cmds"]
set info2 [r client info]
set input2 [get_field_in_client_info $info2 "tot-input"]
set output2 [get_field_in_client_info $info2 "tot-output"]
set input2 [get_field_in_client_info $info2 "tot-net-in"]
set output2 [get_field_in_client_info $info2 "tot-net-out"]
set cmd2 [get_field_in_client_info $info2 "tot-cmds"]
assert_equal [expr $input1+26] $input2
assert {[expr $output1+300] < $output2}
Expand Down

0 comments on commit eb665ca

Please sign in to comment.