aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-14 19:58:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-14 19:58:46 +0100
commitab3698b6fa4613ea34bc3ad52c8cfcea9418c870 (patch)
tree5466845b23d8bfb72c7b8aad4d98ea242a770746 /test/functional/lua
parent6eafa83752e1fe4afbb466eb20bd96ff4bd1dc9f (diff)
downloadrspamd-ab3698b6fa4613ea34bc3ad52c8cfcea9418c870.tar.gz
rspamd-ab3698b6fa4613ea34bc3ad52c8cfcea9418c870.zip
[Test] Add test for virtual symbols
Diffstat (limited to 'test/functional/lua')
-rw-r--r--test/functional/lua/settings.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/functional/lua/settings.lua b/test/functional/lua/settings.lua
index e52325dac..828e1cb37 100644
--- a/test/functional/lua/settings.lua
+++ b/test/functional/lua/settings.lua
@@ -19,11 +19,20 @@ rspamd_config:register_symbol({
end
})
-rspamd_config:register_symbol({
+local id = rspamd_config:register_symbol({
name = 'SIMPLE_TEST',
score = 1.0,
group = 'b',
- callback = function()
+ callback = function(task)
+ task:insert_result('SIMPLE_VIRTUAL', 1.0)
return true, 'Fires always'
end
})
+
+rspamd_config:register_symbol({
+ name = 'SIMPLE_VIRTUAL',
+ type = 'virtual',
+ score = 1.0,
+ group = 'vg',
+ parent = id,
+})