filter-repo: add tests checking error paths in mailmap parsing

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2019-03-13 19:30:24 -07:00
parent 8a1358cc30
commit dd4f3bd111

View File

@ -717,4 +717,26 @@ test_expect_success 'startup sanity checks' '
)
'
test_expect_success 'mailmap sanity checks' '
(
git clone file://"$(pwd)"/analyze_me mailmap_sanity_checks &&
cd mailmap_sanity_checks &&
test_must_fail git filter-repo --mailmap /fake/path 2>../err &&
test_i18ngrep "Cannot read /fake/path" ../err &&
echo "Total Bogus" >../whoopsies &&
test_must_fail git filter-repo --mailmap ../whoopsies 2>../err &&
test_i18ngrep "Unparseable mailmap file" ../err &&
rm ../err &&
rm ../whoopsies &&
echo "Me <me@site.com> Myself <yo@email.com> Extraneous" >../whoopsies &&
test_must_fail git filter-repo --mailmap ../whoopsies 2>../err &&
test_i18ngrep "Unparseable mailmap file" ../err &&
rm ../err &&
rm ../whoopsies
)
'
test_done