summaryrefslogtreecommitdiff
path: root/_quota_selfcheck.lua
diff options
context:
space:
mode:
Diffstat (limited to '_quota_selfcheck.lua')
-rw-r--r--_quota_selfcheck.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/_quota_selfcheck.lua b/_quota_selfcheck.lua
index 4d76bd4..510bddf 100644
--- a/_quota_selfcheck.lua
+++ b/_quota_selfcheck.lua
@@ -51,14 +51,20 @@ local refresh = quota.activate(ext, footer, acp)
assert(quota.activate(ext, footer, acp) == refresh and #hooks.render_footer == 1)
refresh() -- no footer attached: no headless launch
assert(probes == 0)
+hooks.render_footer[1]({has_tui = false, get_component = function() error('footer wrapped in print mode') end})
local component
hooks.render_footer[1]({
+ has_tui = true,
get_component = function() return {render = function() return {'native footer'} end} end,
set_component = function(_, c) component = c; return {invalidate = function() end} end,
})
local function rendered()
return table.concat(component:render(132), '\n'):gsub('\27%[[%d;]*m', '')
end
+hooks.session_ready[1]({has_tui = false})
+refresh()
+assert(rendered() == 'native footer' and probes == 0, 'headless quota read or placeholder')
+hooks.session_ready[1]({has_tui = true})
footer.publish(ext, 'peer', 'peer usage footer')
assert(rendered():find('antigravity usage: awaiting first turn',1,true) and rendered():find('peer usage footer',1,true) and probes == 0)
refresh(); refresh(); assert(probes == 1 and spawns == 0)