From 9dc09b9ede72a8099c87884dae670f3978c3012b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:34:19 -1000 Subject: Check where a Lua filter's loading output lands The test found the text anywhere on the page, so output that slipped behind the closing tag, as print once did, still passed. --- tests/t0201-filters.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index 51eeb52..f84774f 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -122,7 +122,8 @@ test_expect_success CGIT_LUA 'a lua filter raising a table is named by type' ' ' # A script runs its top level before cgit hooks stdout for it, so what it -# writes there goes straight onto the page instead of tripping the hook. +# writes there goes straight onto the page instead of tripping the hook. It +# loads as the filter first opens, which puts the text where the filter runs. test_expect_success CGIT_LUA 'a lua filter that writes while loading still renders' ' cat >loud.lua <<-\EOF && html("written while loading") @@ -131,9 +132,8 @@ test_expect_success CGIT_LUA 'a lua filter that writes while loading still rende function filter_close() return 0 end EOF cgitrc_repo loudrc foo "repo.commit-filter=lua:$PWD/loud.lua" && - cgit_rc loudrc "url=foo/commit" >tmp && - grep "written while loading" tmp && - grep "" tmp + cgit_ok loudrc "url=foo/commit" >tmp && + grep "
written while loading" tmp ' # A Lua build replaces write, and git writes its trace before cgit has run a -- cgit 2.12.1