Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'tests')
| -rwxr-xr-x | 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 "</html>" tmp + cgit_ok loudrc "url=foo/commit" >tmp && + grep "<div class=.commit-subject.>written while loading" tmp ' # A Lua build replaces write, and git writes its trace before cgit has run a |
