Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
| -rwxr-xr-x | tests/t0505-auth.sh | 14 |
1 file changed, 14 insertions, 0 deletions
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 && ( |
