diff options
author | Andrew Lewis <nerf@judo.za.org> | 2022-02-01 13:09:19 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2022-02-01 13:09:19 +0200 |
commit | 225c8d92b64b76bc122d462966dc35109a399da2 (patch) | |
tree | a79e3f0c6d8496b90f2dab67253c23329589a7a3 /test/functional/lua | |
parent | c9f263111e58d83f0953881190511d9683ee118b (diff) | |
download | rspamd-225c8d92b64b76bc122d462966dc35109a399da2.tar.gz rspamd-225c8d92b64b76bc122d462966dc35109a399da2.zip |
[Test] task:remove_symbol() on grouped virtual symbol
Diffstat (limited to 'test/functional/lua')
-rw-r--r-- | test/functional/lua/remove_result.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/lua/remove_result.lua b/test/functional/lua/remove_result.lua new file mode 100644 index 000000000..106d7f4cc --- /dev/null +++ b/test/functional/lua/remove_result.lua @@ -0,0 +1,26 @@ +local id = rspamd_config:register_symbol({ + name = 'REMOVE_RESULT_CB', + callback = function(task) + task:insert_result('REMOVE_RESULT_UNEXPECTED', 1.0, 'ohno') + end, + type = 'callback', +}) + +rspamd_config:register_symbol({ + name = 'REMOVE_RESULT_UNEXPECTED', + type = 'virtual', + score = 0.1, + group = 'remove_result_test', + parent = id, +}) + +rspamd_config:register_symbol({ + name = 'REMOVE_RESULT_EXPECTED', + callback = function(task) + return task:remove_result('REMOVE_RESULT_UNEXPECTED') and true or false + end, + type = 'normal', + score = 0.1, +}) + +rspamd_config:register_dependency('REMOVE_RESULT_EXPECTED', 'REMOVE_RESULT_UNEXPECTED') |