Closed lucky2you closed 2 years ago
I add the testcase below, and it runs failed too.
function test_img()
local tree = htmlparser.parse([[
<e class="a b c" a="2-two">
<img <%tpl%>></img>
</e>
<n b="222"></n>
]])
assert_equal(2, #tree.nodes, "top level")
end
The output
lua-htmlparser/tst$ lua init.lua
------------------------------------
Lua version: Lua 5.1
------------------------------------
Loaded testsuite with 17 tests in 1 testcases.
F...F............
85 Assertions checked.
1) Failure (html.test_void):
init.lua:41: expected 5 but was 1
init.lua:41: top level
2) Failure (html.test_img):
init.lua:340: expected 2 but was 1
init.lua:340: top level
Testsuite finished (15 passed, 2 failed, 0 errors, 0 skipped).
Run the script tst/init.lua, it reports failed.