From df73dca1a539387a12da632f2dd48e34f08d70d0 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 22 May 2022 13:26:45 -0500 Subject: add child rendering --- test.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test.lua') diff --git a/test.lua b/test.lua index 5968e81..a464324 100755 --- a/test.lua +++ b/test.lua @@ -145,3 +145,20 @@ test("marigold.html correctly renders tag attributes", function() local html = marigold.html(tbl) assert(html == '

some paragraph

') end) + + +test("marigold.html correctly renders children", function() + local tbl = { + tag = 'div', content='', attributes = {id="root"}, + children = { + { tag='p', content='p1', attributes = {class="bold"}, children={} }, + { tag='p', content='p2', attributes={}, children={} }, + } + } + + local html = marigold.html(tbl) + assert(html == [[
+

p1

+

p2

+
]]) +end) -- cgit v1.2.1