From 901dccc5b32b306c89c6de586de45daf27d9c32b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 15:09:49 -1000 Subject: Check the two auth filters share their code Both say a change to the code they share belongs in both, but nothing held them to it, so a fix made to one alone in a path the unit checks do not reach would have gone unseen. --- tests/t0505-auth.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/t0505-auth.sh b/tests/t0505-auth.sh index 579bf0f..ae5e299 100755 --- a/tests/t0505-auth.sh +++ b/tests/t0505-auth.sh @@ -51,6 +51,20 @@ do done done +# Both filters say a change to the code they share belongs in both, and the +# only difference allowed is where each defines trim. +test_expect_success 'the two auth filters share their code word for word' ' + sed -n "/^-- The url helpers below/,\$p" "$EXTENSIONS_DIRECTORY/auth-file.lua" >file-tail && + sed -n "/^-- The url helpers below/,\$p" "$EXTENSIONS_DIRECTORY/auth-inline.lua" >inline-whole && + sed "/^-- Lua patterns backtrack/,/^\$/d" inline-whole >inline-tail && + test_line_count -gt 300 file-tail && + test_cmp file-tail inline-tail && + sed -n "/^-- Lua patterns backtrack/,/^end\$/p" "$EXTENSIONS_DIRECTORY/auth-file.lua" >file-trim && + sed -n "/^-- Lua patterns backtrack/,/^end\$/p" "$EXTENSIONS_DIRECTORY/auth-inline.lua" >inline-trim && + test_line_count = 14 file-trim && + test_cmp file-trim inline-trim +' + test_expect_success 'create a repository with one commit' ' test_create_repo repos/authy && ( -- cgit 2.12.1