diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0201-filters.sh | 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 13 insertions, 0 deletions
diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index c2d0ec4..1ffb973 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -130,6 +130,19 @@ test_expect_success CGIT_LUA 'a failing lua filter still renders an error page' grep "Lua error in" err ' +# A script may raise a value that is no string, which the log still names. +test_expect_success CGIT_LUA 'a lua filter raising a table is named by type' ' + cat >tabled.lua <<-\EOF && + function filter_open(...) error({}) end + function filter_write(str) end + function filter_close() return 0 end + EOF + sed "s|broken.lua|tabled.lua|" brokenrc >tabledrc && + CGIT_CONFIG="$PWD/tabledrc" QUERY_STRING="url=foo/commit" cgit >tmp 2>err && + grep "Status: 500" tmp && + grep "Lua error in .*tabled.lua: (error object is a table value)" err +' + # 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. test_expect_success CGIT_LUA 'a lua filter that writes while loading still renders' ' |
