aboutsummaryrefslogtreecommitdiffstats
path: root/test/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-19 16:21:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-19 16:21:42 +0100
commited52028907d845d373c185131ea319833d4a812d (patch)
tree1c5ecbeab54e0371d89c3372529c1f0d1acff150 /test/lua
parentd0e5bf6d4a1a134ae4978a27e4b6e6466601cab0 (diff)
downloadrspamd-ed52028907d845d373c185131ea319833d4a812d.tar.gz
rspamd-ed52028907d845d373c185131ea319833d4a812d.zip
[Feature] Selectors: Add `specific_urls` extractor
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/unit/selectors.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua
index f1a06af30..924c94c48 100644
--- a/test/lua/unit/selectors.lua
+++ b/test/lua/unit/selectors.lua
@@ -151,6 +151,18 @@ context("Selectors test", function()
selector = "emails",
expect = {{"mailto://test@example.net"}}},
+ ["specific_urls"] = {
+ selector = "specific_urls({limit = 1})",
+ expect = {{"http://example.net"}}},
+
+ ["specific_urls + emails"] = {
+ selector = "specific_urls({need_emails = true, limit = 2})",
+ expect = {{"http://example.net", "mailto://test@example.net"}}},
+
+ ["specific_urls + emails limit"] = {
+ selector = "specific_urls({need_emails = true, limit = 1})",
+ expect = {{"http://example.net"}}},
+
["pool_var str, default type"] = {
selector = [[pool_var("str_var")]],
expect = {"str 1"}},