aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-22 11:54:49 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-22 11:54:49 +0100
commiteb644d5f135fe955322a0f21c05bb1c9f16369c3 (patch)
tree228f43d0a16a71dd2775698b684f059f48beec24 /test
parentbaceaa985ebbb23ae7d26a2050f50bfd9544b85c (diff)
downloadrspamd-eb644d5f135fe955322a0f21c05bb1c9f16369c3.tar.gz
rspamd-eb644d5f135fe955322a0f21c05bb1c9f16369c3.zip
Revert "[Test] Check selector before processing"
This reverts commit baceaa985ebbb23ae7d26a2050f50bfd9544b85c.
Diffstat (limited to 'test')
-rw-r--r--test/lua/unit/selectors.lua33
1 files changed, 16 insertions, 17 deletions
diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua
index 8b617cca2..8053912c0 100644
--- a/test/lua/unit/selectors.lua
+++ b/test/lua/unit/selectors.lua
@@ -26,50 +26,49 @@ context("Selectors test", function()
local function check_selector(selector_string)
local sels = lua_selectors.parse_selector(cfg, selector_string)
- assert_not_nil(sels)
local elts = lua_selectors.process_selectors(task, sels)
return elts
end
local cases = {
["ip"] = {
- selector = "ip",
+ selector = "ip",
expect = {"198.172.22.91"}},
["header Subject"] = {
- selector = "header(Subject)",
+ selector = "header(Subject)",
expect = {"Second, lower-cased header subject"}},
["header Subject lower"] = {
- selector = "header(Subject).lower",
+ selector = "header(Subject).lower",
expect = {"second, lower-cased header subject"}},
["header full Subject lower"] = {
- selector = "header(Subject, 'full').lower",
+ selector = "header(Subject, 'full').lower",
expect = {{"second, lower-cased header subject", "test subject"}}},
["header full strong Subject"] = {
- selector = "header(Subject, 'full,strong')",
+ selector = "header(Subject, 'full,strong')",
expect = {{"Test subject"}}},
["header full strong lower-cased Subject"] = {
- selector = "header(subject, 'full,strong')",
+ selector = "header(subject, 'full,strong')",
expect = {{"Second, lower-cased header subject"}}},
["digest"] = {
- selector = "digest",
+ selector = "digest",
expect = {"2216397bc061bb6968e1836f3680fed0"}},
["user"] = {
- selector = "user",
+ selector = "user",
expect = {"cool user name"}},
["from"] = {
- selector = "from",
+ selector = "from",
expect = {"whoknows@nowhere.com"}},
["rcpts"] = {
- selector = "rcpts",
+ selector = "rcpts",
expect = {{"nobody@example.com", "no-one@example.com"}}},
["1st rcpts"] = {
@@ -81,7 +80,7 @@ context("Selectors test", function()
expect = {"nobody@example.com"}},
["first rcpts"] = {
- selector = "rcpts.first",
+ selector = "rcpts.first",
expect = {"nobody@example.com"}},
["first addr rcpts"] = {
@@ -89,7 +88,7 @@ context("Selectors test", function()
expect = {"nobody@example.com"}},
["to"] = {
- selector = "to",
+ selector = "to",
expect = {"nobody@example.com"}},
["attachments"] = {
@@ -107,7 +106,7 @@ context("Selectors test", function()
expect = {{"f.zip", "f2.zip"}}},
["helo"] = {
- selector = "helo",
+ selector = "helo",
expect = {"hello mail"}},
["received by hostname"] = {
@@ -115,7 +114,7 @@ context("Selectors test", function()
expect = {{"server.chat-met-vreemden.nl"}}},
["urls"] = {
- selector = "urls",
+ selector = "urls",
expect = {{"http://example.net"}}},
["emails"] = {
@@ -135,11 +134,11 @@ context("Selectors test", function()
expect = {"1"}},
["time"] = {
- selector = "time",
+ selector = "time",
expect = {"1537364211"}},
["request_header"] = {
- selector = "request_header(hdr1)",
+ selector = "request_header(hdr1)",
expect = {"value1"}},
["get_host"] = {