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
83026101
Commit
83026101
authored
Mar 18, 2019
by
Yossi Gottlieb
Committed by
antirez
May 13, 2019
Browse files
Add command filter Module API tests.
parent
dc5edc7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/modules/commandfilter.tcl
0 → 100644
View file @
83026101
set testmodule
[
file normalize src/modules/hellofilter.so
]
start_server
{
tags
{
"modules"
}}
{
r module load $testmodule log-key
test
{
Command Filter handles redirected commands
}
{
r set mykey @log
r lrange log-key 0 -1
}
"{hellofilter.log set mykey @log}"
test
{
Command Filter can call RedisModule_CommandFilterArgDelete
}
{
r rpush mylist elem1 @delme elem2
r lrange mylist 0 -1
}
{
elem1 elem2
}
test
{
Command Filter can call RedisModule_CommandFilterArgInsert
}
{
r del mylist
r rpush mylist elem1 @insertbefore elem2 @insertafter elem3
r lrange mylist 0 -1
}
{
elem1 --inserted-before-- @insertbefore elem2 @insertafter --inserted-after-- elem3
}
test
{
Command Filter can call RedisModule_CommandFilterArgReplace
}
{
r del mylist
r rpush mylist elem1 @replaceme elem2
r lrange mylist 0 -1
}
{
elem1 --replaced-- elem2
}
}
tests/test_helper.tcl
View file @
83026101
...
@@ -62,6 +62,7 @@ set ::all_tests {
...
@@ -62,6 +62,7 @@ set ::all_tests {
unit/lazyfree
unit/lazyfree
unit/wait
unit/wait
unit/pendingquerybuf
unit/pendingquerybuf
modules/commandfilter
}
}
# Index to the next test to run in the ::all_tests list.
# Index to the next test to run in the ::all_tests list.
set ::next_test 0
set ::next_test 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