diff --git a/tst/init.lua b/tst/init.lua index fe62536..fc80b37 100644 --- a/tst/init.lua +++ b/tst/init.lua @@ -6,9 +6,9 @@ local lunitx = require("lunitx") module("html", lunitx.testcase, package.seeall) local htmlparser = require("htmlparser") +local tree, sel -function test_children() - local tree, sel +function test_descendants() tree = htmlparser.parse([[ 1 1.1 @@ -25,6 +25,23 @@ function test_children() ]]) sel = tree("parent child") assert_equal(6, sel:len(), 'parent child') +end + +function test_children() + tree = htmlparser.parse([[ + 1 + 1.1 + 1.2 + 1.2.1 + + + 2 + 2.1 + 2.2 + 2.2.1 + + + ]]) sel = tree("parent > child") assert_equal(4, sel:len(), 'parent > child') end \ No newline at end of file