Explorar el Código

[Test] Test option order

tags/1.5.4
Andrew Lewis hace 7 años
padre
commit
dfd336d4e9
Se han modificado 2 ficheros con 22 adiciones y 0 borrados
  1. 7
    0
      test/functional/cases/101_lua.robot
  2. 15
    0
      test/functional/lua/option_order.lua

+ 7
- 0
test/functional/cases/101_lua.robot Ver fichero

@@ -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}

+ 15
- 0
test/functional/lua/option_order.lua Ver fichero

@@ -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
})

Cargando…
Cancelar
Guardar