From: Felipe Contreras Date: Tue, 14 Feb 2012 23:32:28 GMT Subject: [PATCH v3 2/2] t: mailmap: add simple name translation test Message-ID: <1329262348-9546-3-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1329262348-9546-1-git-send-email-felipe.contreras@gmail.com> There's already tests for this, but they don't check the output of 'git blame'. Note that the output of 'git blame -e' was fixed in commit f026358 [1], so the test would fail before that. [1] mailmap: always return a plain mail address from map_user() Signed-off-by: Felipe Contreras --- t/t4203-mailmap.sh | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index ec5d98c..d2bab98 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -157,6 +157,9 @@ A U Thor (1): CTO (1): seventh +Mr. Right (1): + eight + Other Author (2): third fourth @@ -196,6 +199,11 @@ test_expect_success 'Shortlog output (complex mapping)' ' test_tick && git commit --author "CTO " -m seventh && + echo eight >>one && + git add one && + test_tick && + git commit --author "Wrong " -m eight && + mkdir -p internal_mailmap && echo "Committed " > internal_mailmap/.mailmap && echo " " >> internal_mailmap/.mailmap && @@ -204,6 +212,7 @@ test_expect_success 'Shortlog output (complex mapping)' ' echo "Other Author " >> internal_mailmap/.mailmap && echo "Santa Claus " >> internal_mailmap/.mailmap && echo "Santa Claus " >> internal_mailmap/.mailmap && + echo "Mr. Right " >> internal_mailmap/.mailmap && git shortlog -e HEAD >actual && test_cmp expect actual @@ -212,6 +221,9 @@ test_expect_success 'Shortlog output (complex mapping)' ' # git log with --pretty format which uses the name and email mailmap placemarkers cat >expect <<\EOF +Author Wrong maps to Mr. Right +Committer C O Mitter maps to Committed + Author CTO maps to CTO Committer C O Mitter maps to Committed @@ -248,6 +260,7 @@ OBJID (Other Author DATE 4) four OBJID (Santa Claus DATE 5) five OBJID (Santa Claus DATE 6) six OBJID (CTO DATE 7) seven +OBJID (Mr. Right DATE 8) eight EOF test_expect_success 'Blame output (complex mapping)' ' git blame one >actual && @@ -264,6 +277,7 @@ OBJID ( DATE 4) four OBJID ( DATE 5) five OBJID ( DATE 6) six OBJID ( DATE 7) seven +OBJID ( DATE 8) eight EOF test_expect_success 'Blame show email output (complex mapping)' ' git blame -e one >actual && -- 1.7.9