From: Vsevolod Stakhov Date: Tue, 22 Nov 2022 23:41:33 +0000 (+0000) Subject: [Minor] Fix tests and invocation X-Git-Tag: 3.5~197 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5858739fec90975fb2067374b06999dc8344597d;p=rspamd.git [Minor] Fix tests and invocation --- diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua index 6dec5ea7f..01b43756a 100644 --- a/lualib/lua_selectors/init.lua +++ b/lualib/lua_selectors/init.lua @@ -580,7 +580,7 @@ exports.create_selector_closure_fn = function(log_obj, cfg, selector_str, delimi local res = exports.process_selectors(task, selector) if res then - fn(log_obj, res, delimiter) + return fn(log_obj, res, delimiter) end return nil diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua index 4ac2c7bcb..c2fe4d7bd 100644 --- a/test/lua/unit/selectors.lua +++ b/test/lua/unit/selectors.lua @@ -35,8 +35,9 @@ context("Selectors test", function() end) local function check_selector(selector_string) - local sels = lua_selectors.parse_selector(cfg, selector_string) - local elts = lua_selectors.process_selectors(task, sels) + local sels = lua_selectors.create_selector_closure_fn(nil, cfg, selector_string, nil, + function(_, res, _) return res end) + local elts = sels(task) return elts end