]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add a unit test for buckets variables in the mempool
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 2 May 2021 19:34:43 +0000 (20:34 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 2 May 2021 19:34:43 +0000 (20:34 +0100)
test/lua/unit/mempool.lua

index 7bb4046468d53dd4f623ca874196e9e5dbb0d79d..fefd3d279cf3d0327760fc5cd819b82724404c00 100644 (file)
@@ -33,7 +33,15 @@ context("Memory pool unit tests", function()
     assert_equal(v2, 1)
     assert_equal(v3, 1.01)
     assert_equal(v4, false)
-    
+
+    local t = {1,2,3,4,5}
+    pool:set_variable('a', t)
+    local bucket = pool:get_variable('a', 'bucket')
+    assert_rspamd_table_eq({
+      expect = t,
+      actual = bucket
+    })
+
     pool:destroy()
   end)
 end)
\ No newline at end of file