diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-19 13:51:30 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-19 13:51:30 +0100 |
commit | 30cbcd080977a0c00cbe160d6a350549ea4bf7fd (patch) | |
tree | 144b8505521c1ced0ea2c712d03deb652b91e441 /test/lua | |
parent | e07897872dd260a7ff21719b7d9206e8d7034ada (diff) | |
download | rspamd-30cbcd080977a0c00cbe160d6a350549ea4bf7fd.tar.gz rspamd-30cbcd080977a0c00cbe160d6a350549ea4bf7fd.zip |
[Test] Add some more tests for maps in selectors
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/unit/selectors.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua index 0aba4d663..b5152e347 100644 --- a/test/lua/unit/selectors.lua +++ b/test/lua/unit/selectors.lua @@ -13,6 +13,7 @@ context("Selectors test", function() lua_selectors.maps.test_map = lua_maps.map_add_from_ucl({ 'key value', 'key1 value1', + 'key3 value1', }, 'hash', 'test selectors maps') before(function() @@ -254,6 +255,18 @@ context("Selectors test", function() selector = "id('key').apply_map(test_map)", expect = {'value'} }, + ["map filter list"] = { + selector = "list('key', 'key1', 'key2').filter_map(test_map)", + expect = {{'key', 'key1'}} + }, + ["map apply list"] = { + selector = "list('key', 'key1', 'key2', 'key3').apply_map(test_map)", + expect = {{'value', 'value1', 'value1'}} + }, + ["map apply list uniq"] = { + selector = "list('key', 'key1', 'key2', 'key3').apply_map(test_map).uniq", + expect = {{'value1', 'value'}} + }, } for case_name, case in pairs(cases) do |