From eb644d5f135fe955322a0f21c05bb1c9f16369c3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 22 Sep 2018 11:54:49 +0100 Subject: [PATCH] Revert "[Test] Check selector before processing" This reverts commit baceaa985ebbb23ae7d26a2050f50bfd9544b85c. --- test/lua/unit/selectors.lua | 33 ++++++++++++++++----------------- 1 file 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"] = { -- 2.39.5