From b51ce988891efc800acd2a2847d422c4cfba6109 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 11 Sep 2017 16:05:51 +0200 Subject: [PATCH] [Minor] Fix tests --- rules/html.lua | 3 +-- src/plugins/lua/antivirus.lua | 3 +-- test/functional/lua/url_tags.lua | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rules/html.lua b/rules/html.lua index 7c88928eb..81555839b 100644 --- a/rules/html.lua +++ b/rules/html.lua @@ -173,13 +173,12 @@ rspamd_config.R_WHITE_ON_WHITE = { local tp = task:get_text_parts() -- get text parts in a message local ret = false local diff = 0.0 - local normal_len = 0 local transp_rate = 0 local arg for _,p in ipairs(tp) do -- iterate over text parts array using `ipairs` if p:is_html() and p:get_html() then -- if the current part is html part - normal_len = p:get_length() + local normal_len = p:get_length() local transp_len = 0 local hc = p:get_html() -- we get HTML context diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index 4802b239e..652ab03f6 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -739,7 +739,6 @@ local av_types = { } local function add_antivirus_rule(sym, opts) - local rule = {} if not opts['type'] then return nil end @@ -752,7 +751,7 @@ local function add_antivirus_rule(sym, opts) opts['type']) end - rule = cfg.configure(opts) + local rule = cfg.configure(opts) if not rule then rspamd_logger.errx(rspamd_config, 'cannot configure %s for %s', diff --git a/test/functional/lua/url_tags.lua b/test/functional/lua/url_tags.lua index 6c2e07a7f..9dc38ac72 100644 --- a/test/functional/lua/url_tags.lua +++ b/test/functional/lua/url_tags.lua @@ -1,3 +1,4 @@ + local rspamd_logger = require 'rspamd_logger' rspamd_config:register_symbol({ -- 2.39.5