diff options
author | sanine <sanine.not@pm.me> | 2022-05-22 13:18:09 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-05-22 13:18:09 -0500 |
commit | 23e77b891e735b68ed0d83b1b1d4560fb5224785 (patch) | |
tree | 61f8eb2531d97b36c87c2ec67865ced1aa6b3a96 /test.lua | |
parent | 7188614f0e2103f2cfc87dd0cb268f82fafd8c22 (diff) |
add basic html rendering
Diffstat (limited to 'test.lua')
-rwxr-xr-x | test.lua | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -127,5 +127,21 @@ test("marigold.h correctly sets attributes and children", function() assert(div.children[1].content == 'the first paragraph') assert(div.children[2].tag == 'p') assert(div.children[2].content == 'the second paragraph') +end) + + +test("marigold.html correctly renders basic html table", function() + local tbl = { tag='p', content='some paragraph', attributes={}, children={}} + local html = marigold.html(tbl) + assert(html == '<p>some paragraph</p>') +end) + +test("marigold.html correctly renders tag attributes", function() + local tbl = { + tag='p', content='some paragraph', + attributes={ id='p1', class='blinking bold' }, + children={}} + local html = marigold.html(tbl) + assert(html == '<p class="blinking bold" id="p1">some paragraph</p>') end) |