diff options
author | sanine <sanine.not@pm.me> | 2022-05-22 13:26:45 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-05-22 13:26:45 -0500 |
commit | df73dca1a539387a12da632f2dd48e34f08d70d0 (patch) | |
tree | 0f4dc3cce3d05ab455940981f23d9e8d868205e5 /test.lua | |
parent | 23e77b891e735b68ed0d83b1b1d4560fb5224785 (diff) |
add child rendering
Diffstat (limited to 'test.lua')
-rwxr-xr-x | test.lua | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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) |