diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-17 22:22:04 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-17 23:29:49 +0000 |
commit | a6e30390f384a5dd6446542436d45fd983af565b (patch) | |
tree | ae20caf772cdc74ea36508df55b000690a7daa14 /test/lua | |
parent | cc544380dd8034bdedbb51211a96cd6119546f7d (diff) | |
download | rspamd-a6e30390f384a5dd6446542436d45fd983af565b.tar.gz rspamd-a6e30390f384a5dd6446542436d45fd983af565b.zip |
Fix expressions unit test.
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/unit/expressions.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/lua/unit/expressions.lua b/test/lua/unit/expressions.lua index dc9cfd0cb..4c6c55f7d 100644 --- a/test/lua/unit/expressions.lua +++ b/test/lua/unit/expressions.lua @@ -3,11 +3,12 @@ context("Rspamd expressions", function() local rspamd_expression = require "rspamd_expression" local rspamd_mempool = require "rspamd_mempool" - local _ = require "fun" + local rspamd_regexp = require "rspamd_regexp" + local split_re = rspamd_regexp.create('/\\s+/') local function parse_func(str) -- extract token till the first space character - local token = table.join('', take_while(function(s) return s ~= ' ' end, str)) + local token = split_re:split(str)[1] -- Return token name return token end @@ -27,7 +28,7 @@ context("Rspamd expressions", function() {parse_func, process_func}, pool) if c[2] then - assert_not_null(expr, "Cannot parse " .. c[1] ": " .. err) + assert_not_nil(expr, "Cannot parse " .. c[1] ": " .. err) else assert_equal(expr:to_string(), c[2], string.format("Evaluated expr to '%s', expected: '%s'", expr:to_string(), c[2])) |