[PATCH 18/22] mailmap tests: add a test for comment syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a test for mailmap comment syntax. As noted in [1] there was no
test coverage for this. Let's make sure a future change doesn't break
it.

1. https://lore.kernel.org/git/CAN0heSoKYWXqskCR=GPreSHc6twCSo1345WTmiPdrR57XSShhA@xxxxxxxxxxxxxx/

Reported-by: Martin Ågren <martin.agren@xxxxxxxxx>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 t/t4203-mailmap.sh | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 96ba5367c6..10e672e006 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -753,4 +753,37 @@ test_expect_success 'commit --author honors mailmap' '
 	test_cmp expect actual
 '
 
+test_expect_success 'comment syntax: setup' '
+	test_create_repo comm &&
+	test_commit -C comm --author "A <a@xxxxxxxxxxx>" A &&
+	test_commit -C comm --author "B <b@xxxxxxxxxxx>" B &&
+	test_commit -C comm --author "C <#@example.com>" C &&
+	test_commit -C comm --author "D <d@e#ample.com>" D &&
+
+	test_config -C comm mailmap.file ../doc.map &&
+	cat >>doc.map <<-\EOF &&
+	# Ah <a@xxxxxxxxxxx>
+
+	; Bee <b@xxxxxxxxxxx>
+	Cee <cee@xxxxxxxxxxx> <#@example.com>
+	Dee <dee@xxxxxxxxxxx> <d@e#ample.com>
+	EOF
+
+	cat >expect <<-\EOF &&
+	Author A <a@xxxxxxxxxxx> maps to A <a@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author B <b@xxxxxxxxxxx> maps to ; Bee <b@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author C <#@example.com> maps to Cee <cee@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author D <d@e#ample.com> maps to Dee <dee@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+	EOF
+	git -C comm log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
+	test_cmp expect actual
+'
+
 test_done
-- 
2.29.2.222.g5d2a92d10f8




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux