summaryrefslogtreecommitdiff
path: root/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test.lua')
-rwxr-xr-xtest.lua17
1 files changed, 17 insertions, 0 deletions
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 == '<p class="blinking bold" id="p1">some paragraph</p>')
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 == [[<div id="root">
+ <p class="bold">p1</p>
+ <p>p2</p>
+</div>]])
+end)