From: Andrew Lewis Date: Thu, 23 Mar 2017 11:00:35 +0000 (+0200) Subject: [Test] Test option order X-Git-Tag: 1.5.4~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfd336d4e92f73b156cf5e3faf7a0b87fd689267;p=thirdparty%2Frspamd.git [Test] Test option order --- diff --git a/test/functional/cases/101_lua.robot b/test/functional/cases/101_lua.robot index f3121daf8a..da5f8420b2 100644 --- a/test/functional/cases/101_lua.robot +++ b/test/functional/cases/101_lua.robot @@ -56,6 +56,13 @@ Maps Key Values Should Contain ${result.stdout} REGEXP_KV (1.00)[no worry] Should Contain ${result.stdout} MAP_KV (1.00)[no worry] +Option Order + [Setup] Lua Replace Setup ${TESTDIR}/lua/option_order.lua + [Teardown] Lua Replace Teardown + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} OPTION_ORDER (1.00)[one, two, three, 4, 5, a] + Should Contain ${result.stdout} TBL_OPTION_ORDER (1.00)[one, two, three, 4, 5, a] + *** Keywords *** Lua Setup [Arguments] ${LUA_SCRIPT} diff --git a/test/functional/lua/option_order.lua b/test/functional/lua/option_order.lua new file mode 100644 index 0000000000..caff30f908 --- /dev/null +++ b/test/functional/lua/option_order.lua @@ -0,0 +1,15 @@ +rspamd_config:register_symbol({ + name = 'TBL_OPTION_ORDER', + score = 1.0, + callback = function() + return true, {'one', 'two', 'three', '4', '5', 'a'} + end +}) + +rspamd_config:register_symbol({ + name = 'OPTION_ORDER', + score = 1.0, + callback = function() + return true, 'one', 'two', 'three', '4', '5', 'a' + end +})