Debian Codegraph @

test/functional/lua/limits.lua

raw
1 local true_cb_gen = function()
2 return function()
3 return true
4 end
5 end
6
7 local test_weights = { 1, 2, 4, 8, 16 }
8 for _, i in ipairs(test_weights) do
9 rspamd_config:register_symbol('GR_POSITIVE' .. tostring(i), 1.0, true_cb_gen())
10
11 if i > 1 then
12 local half = math.floor(i / 2)
13 rspamd_config:register_dependency('GR_POSITIVE' .. tostring(i), 'GR_POSITIVE' .. tostring(half))
14 end
15
16 rspamd_config:register_symbol('GR_NEGATIVE' .. tostring(i), 1.0, true_cb_gen())
17
18 if i > 1 then
19 local half = math.floor(i / 2)
20 rspamd_config:register_dependency('GR_NEGATIVE' .. tostring(i), 'GR_NEGATIVE' .. tostring(half))
21 end
22 end
23
24 rspamd_config:register_dependency('GR_NEGATIVE1', 'GR_POSITIVE16')