]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Test option order
authorAndrew Lewis <nerf@judo.za.org>
Thu, 23 Mar 2017 11:00:35 +0000 (13:00 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Thu, 23 Mar 2017 11:07:38 +0000 (13:07 +0200)
test/functional/cases/101_lua.robot
test/functional/lua/option_order.lua [new file with mode: 0644]

index f3121daf8ae81a074f0da5f8cced9425f4c1b09f..da5f8420b2c823819b1915e5d835c7d8f4f61db6 100644 (file)
@@ -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 (file)
index 0000000..caff30f
--- /dev/null
@@ -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
+})