summaryrefslogtreecommitdiff
path: root/tests/modules/commandfilter.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modules/commandfilter.tcl')
-rw-r--r--tests/modules/commandfilter.tcl20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/modules/commandfilter.tcl b/tests/modules/commandfilter.tcl
index f0d96b259..47d9c302c 100644
--- a/tests/modules/commandfilter.tcl
+++ b/tests/modules/commandfilter.tcl
@@ -6,7 +6,7 @@ start_server {tags {"modules"}} {
test {Command Filter handles redirected commands} {
r set mykey @log
r lrange log-key 0 -1
- } "{hellofilter.log set mykey @log}"
+ } "{set mykey @log}"
test {Command Filter can call RedisModule_CommandFilterArgDelete} {
r rpush mylist elem1 @delme elem2
@@ -24,4 +24,22 @@ start_server {tags {"modules"}} {
r rpush mylist elem1 @replaceme elem2
r lrange mylist 0 -1
} {elem1 --replaced-- elem2}
+
+ test {Command Filter applies on RM_Call() commands} {
+ r del log-key
+ r hellofilter.ping
+ r lrange log-key 0 -1
+ } "{ping @log}"
+
+ test {Command Filter applies on Lua redis.call()} {
+ r del log-key
+ r eval "redis.call('ping', '@log')" 0
+ r lrange log-key 0 -1
+ } "{ping @log}"
+
+ test {Command Filter applies on Lua redis.call() that calls a module} {
+ r del log-key
+ r eval "redis.call('hellofilter.ping')" 0
+ r lrange log-key 0 -1
+ } "{ping @log}"
}