diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-07 14:06:09 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-07 15:04:29 +0100 |
commit | f606fef31c6f94a3a7568a1c1cbfa50872810c7d (patch) | |
tree | 3d7ecaf24e163bcae158176ec648e4a475f40643 /test | |
parent | 6ac62f6509c0cbb17486e935f63d6e519b37c730 (diff) | |
download | rspamd-f606fef31c6f94a3a7568a1c1cbfa50872810c7d.tar.gz rspamd-f606fef31c6f94a3a7568a1c1cbfa50872810c7d.zip |
Fix urls unit test.
Diffstat (limited to 'test')
-rw-r--r-- | test/lua/unit/url.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/lua/unit/url.lua b/test/lua/unit/url.lua index a593ac153..e0b229131 100644 --- a/test/lua/unit/url.lua +++ b/test/lua/unit/url.lua @@ -40,7 +40,7 @@ context("URL check functions", function() }; struct rspamd_config; struct rspamd_url* rspamd_url_get_next (void *pool, - const char *start, char const **pos); + const char *start, char const **pos, int *statep); void * rspamd_mempool_new (unsigned long size); void rspamd_url_init (const char *tld_file); ]] @@ -54,10 +54,12 @@ context("URL check functions", function() {"http://user:password@тест2.РФ:18 text", {"тест2.рф", "user"}}, } - ffi.C.rspamd_url_init(nil) + local test_dir = string.gsub(debug.getinfo(1).source, "^@(.+/)[^/]+$", "%1") + + ffi.C.rspamd_url_init(string.format('%s/%s', test_dir, "test_tld.dat")) for _,c in ipairs(cases) do - local res = ffi.C.rspamd_url_get_next(pool, c[1], nil) + local res = ffi.C.rspamd_url_get_next(pool, c[1], nil, nil) assert_not_nil(res, "cannot parse " .. c[1]) assert_equal(c[2][1], ffi.string(res.host, res.hostlen)) |