From dd4f3bd111757dd0c731598249ea527d5724317c Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 13 Mar 2019 19:30:24 -0700 Subject: [PATCH] filter-repo: add tests checking error paths in mailmap parsing Signed-off-by: Elijah Newren --- t/t9390-filter-repo.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/t/t9390-filter-repo.sh b/t/t9390-filter-repo.sh index 9017aa9..c7a73bf 100755 --- a/t/t9390-filter-repo.sh +++ b/t/t9390-filter-repo.sh @@ -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 Myself Extraneous" >../whoopsies && + test_must_fail git filter-repo --mailmap ../whoopsies 2>../err && + test_i18ngrep "Unparseable mailmap file" ../err && + rm ../err && + rm ../whoopsies + ) +' + test_done