spec(module_doc): add "Signals" test

This commit is contained in:
Aire-One 2023-05-04 00:46:27 +02:00
parent 5d45637954
commit 65320173e5
1 changed files with 50 additions and 0 deletions

View File

@ -19,4 +19,54 @@ describe("Scrap documentation", function()
})
assert.same(nodes, {})
end)
it("should produce Signal nodes", function()
local ast <const> = get_doc_from_page([[
<h2 class="section-header"><a name="Signals"></a>Signals</h2>
<dl class="function">
<dt>
<a
class="copy-link js-copy-link"
name="widget::layout_changed"
href="#widget::layout_changed"
>🔗</a
>
<strong>widget::layout_changed</strong>
<span class="baseclass"> ·&nbsp;Inherited from wibox.widget.base </span>
</dt>
<dd></dd>
<dt>
<a
class="copy-link js-copy-link"
name="widget::redraw_needed"
href="#widget::redraw_needed"
>🔗</a
>
<strong>widget::redraw_needed</strong>
<span class="baseclass"> ·&nbsp;Inherited from wibox.widget.base </span>
</dt>
<dd></dd>
</dl>
]], "signal")
assert.same(ast, {
children = {
{
children = {
{
name = "widget::layout_changed",
token = "identifier",
},
{
name = "widget::redraw_needed",
token = "identifier",
},
},
name = "Signal",
token = "enum",
},
},
name = "Signal",
token = "module",
})
end)
end)