]> git.saurik.com Git - redis.git/blob - tests/unit/introspection.tcl
Tests for MONITOR.
[redis.git] / tests / unit / introspection.tcl
1 start_server {tags {"introspection"}} {
2 test {CLIENT LIST} {
3 r client list
4 } {*addr=*:* fd=* age=* idle=* flags=N db=9 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=* obl=0 oll=0 omem=0 events=r cmd=client*}
5
6 test {MONITOR can log executed commands} {
7 set rd [redis_deferring_client]
8 $rd monitor
9 r set foo bar
10 r get foo
11 list [$rd read] [$rd read] [$rd read]
12 } {*OK*"set" "foo"*"get" "foo"*}
13
14 test {MONITOR can log commands issued by the scripting engine} {
15 set rd [redis_deferring_client]
16 $rd monitor
17 r eval {redis.call('set',KEYS[1],ARGV[1])} 1 foo bar
18 $rd read ;# Discard the OK
19 assert_match {*eval*} [$rd read]
20 assert_match {*lua*"set"*"foo"*"bar"*} [$rd read]
21 }
22 }