commit ba22ea7: [Test] Add some missing tests for selectors

Vsevolod Stakhov vsevolod at highsecure.ru
Thu May 14 12:21:18 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-05-14 12:43:19 +0100
URL: https://github.com/rspamd/rspamd/commit/ba22ea79c6eaffa684c7122162612c0429f756a5

[Test] Add some missing tests for selectors

---
 test/lua/unit/selectors.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua
index 294e98b62..dea80fdbf 100644
--- a/test/lua/unit/selectors.lua
+++ b/test/lua/unit/selectors.lua
@@ -342,6 +342,14 @@ context("Selectors test", function()
       selector = "header(X-Test, full).last",
       expect = {"3"}
     },
+    ["header lower digest substring"] = {
+      selector = "header('Subject').lower.digest('hex').substring(1, 16)",
+      expect = {"736ad5f50fc95d73"}
+    },
+    ["header gsub"] = {
+      selector = "header('Subject'):gsub('a', 'b')",
+      expect = {"Second, lower-cbsed hebder subject"}
+    },
   }
 
   for case_name, case in pairs(cases) do


More information about the Commits mailing list