aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-16 13:54:21 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-16 13:54:21 +0000
commit454f4676389738808d2231d6813e5eb70167efbe (patch)
tree1739b6fef1c245066b0d6054a020d4312d186237 /test
parent1341b6bfbea28028eb12d833beeebc60c10dc00e (diff)
downloadrspamd-454f4676389738808d2231d6813e5eb70167efbe.tar.gz
rspamd-454f4676389738808d2231d6813e5eb70167efbe.zip
Fix HTML tests
Diffstat (limited to 'test')
-rw-r--r--test/lua/unit/html.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/lua/unit/html.lua b/test/lua/unit/html.lua
index f29d4eb3b..f1408c25a 100644
--- a/test/lua/unit/html.lua
+++ b/test/lua/unit/html.lua
@@ -1,7 +1,7 @@
context("HTML processing", function()
local rspamd_util = require("rspamd_util")
local logger = require("rspamd_logger")
-
+
test("Extract text from HTML", function()
local cases = {
{[[
@@ -21,10 +21,10 @@ context("HTML processing", function()
<b>stuff</p>?
</body>
</html>
- ]], "Hello, world! test\r\ndata\r\nstuff?"},
+ ]], "Hello, world! test data\r\nstuff?"},
{[[
<?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE html
+ <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -35,11 +35,11 @@ context("HTML processing", function()
</head>
<body>
<p>
- Hello, world!
-
+ Hello, world!
+
</p>
</body>
- </html>]], '\r\nHello, world!\r\n'},
+ </html>]], 'Hello, world!\r\n'},
{[[
<!DOCTYPE html>
<html lang="en">
@@ -58,12 +58,12 @@ context("HTML processing", function()
</html>
]], 'Hello, world!'},
}
-
+
for _,c in ipairs(cases) do
local t = rspamd_util.parse_html(c[1])
-
+
assert_not_nil(t)
assert_equal(c[2], tostring(t))
end
end)
-end) \ No newline at end of file
+end)