diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-02 13:22:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-02 13:22:35 +0000 |
commit | 49b2f29ae1fbabe6612f4c64d977de6df3471759 (patch) | |
tree | 230f506c13789f4d5f7c20329b28aa2b9970c3e1 /test | |
parent | 47a4e94b6f593a4098ff1a2231b6ee3be677e3cd (diff) | |
download | rspamd-49b2f29ae1fbabe6612f4c64d977de6df3471759.tar.gz rspamd-49b2f29ae1fbabe6612f4c64d977de6df3471759.zip |
Fix broken asserts.
Diffstat (limited to 'test')
-rw-r--r-- | test/lua/telescope.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/lua/telescope.lua b/test/lua/telescope.lua index abe96bcf9..098f879ea 100644 --- a/test/lua/telescope.lua +++ b/test/lua/telescope.lua @@ -179,7 +179,7 @@ local function make_assertion(name, message, func) local a = {} local args = {...} local nargs = select('#', ...) - if nargs > num_vars then + if nargs > num_vars then local userErrorMessage = args[num_vars+1] if type(userErrorMessage) == "string" then return(assertion_message_prefix .. userErrorMessage) @@ -187,7 +187,7 @@ local function make_assertion(name, message, func) error(string.format('assert_%s expected %d arguments but got %d', name, num_vars, #args)) end end - for i = 1, nargs do a[i] = tostring(v) end + for i = 1, nargs do a[i] = tostring(args[i]) end for i = nargs+1, num_vars do a[i] = 'nil' end return (assertion_message_prefix .. message):format(unpack(a)) end @@ -467,12 +467,12 @@ local function run(contexts, callbacks, test_filter) table.sort(ancestors) -- this "before" is the test callback passed into the runner invoke_callback("before", result) - + -- run all the "before" blocks/functions for _, a in ipairs(ancestors) do - if contexts[a].before then + if contexts[a].before then setfenv(contexts[a].before, env) - contexts[a].before() + contexts[a].before() end end @@ -489,9 +489,9 @@ local function run(contexts, callbacks, test_filter) -- Run all the "after" blocks/functions table.reverse(ancestors) for _, a in ipairs(ancestors) do - if contexts[a].after then + if contexts[a].after then setfenv(contexts[a].after, env) - contexts[a].after() + contexts[a].after() end end |