aboutsummaryrefslogtreecommitdiffstats
path: root/test/lua/unit
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-10 16:16:56 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-10 16:16:56 +0000
commit2ff5ecbe9b17c055ac3e97dee2c1085b3903addd (patch)
treeee6211a21403fca403064cca26fcaa88b77fc0ea /test/lua/unit
parentbe9abe795333dd76eaab83c2d765eefe98b10db7 (diff)
downloadrspamd-2ff5ecbe9b17c055ac3e97dee2c1085b3903addd.tar.gz
rspamd-2ff5ecbe9b17c055ac3e97dee2c1085b3903addd.zip
[Test] Add more tests
Diffstat (limited to 'test/lua/unit')
-rw-r--r--test/lua/unit/url.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/lua/unit/url.lua b/test/lua/unit/url.lua
index 269b7841b..894c3156e 100644
--- a/test/lua/unit/url.lua
+++ b/test/lua/unit/url.lua
@@ -56,6 +56,15 @@ context("URL check functions", function()
end
cases = {
+ {"http:/\\[::eeee:192.168.0.1]/#test", true, {
+ host = '::eeee:c0a8:1', fragment = 'test'
+ }},
+ {"http:/\\[::eeee:192.168.0.1]#test", true, {
+ host = '::eeee:c0a8:1', fragment = 'test'
+ }},
+ {"http:/\\[::eeee:192.168.0.1]?test", true, {
+ host = '::eeee:c0a8:1', query = 'test'
+ }},
{"http:\\\\%30%78%63%30%2e%30%32%35%30.01", true, { --0xc0.0250.01
host = '192.168.0.1',
}},
@@ -89,9 +98,6 @@ context("URL check functions", function()
{"http://192.168.0.1.?foo", true, {
host = '192.168.0.1', query = 'foo',
}},
- {"http:/\\[::eeee:192.168.0.1]#test", true, {
- host = '::eeee:c0a8:1', fragment = 'test'
- }},
{"http://twitter.com#test", true, {
host = 'twitter.com', fragment = 'test'
}},
@@ -104,9 +110,9 @@ context("URL check functions", function()
for i,c in ipairs(cases) do
local res = url.create(pool, c[1])
- test("Parse urls " .. i, function()
+ test("Parse url: " .. c[1], function()
if c[2] then
- assert_not_nil(res, "cannot parse " .. c[1])
+ assert_not_nil(res, "we are able to parse url: " .. c[1])
local uf = res:to_table()