[PATCH 19/22] mailmap tests: add tests for whitespace syntax

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

 



Add tests for mailmap's handling of whitespace, i.e. how it trims
space within "<>" and around author names.

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

diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 10e672e006..4f61655c04 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -786,4 +786,56 @@ test_expect_success 'comment syntax: setup' '
 	test_cmp expect actual
 '
 
+test_expect_success 'whitespace syntax: setup' '
+	test_create_repo space &&
+	test_commit -C space --author "A <a@xxxxxxxxxxx>" A &&
+	test_commit -C space --author "B <b@xxxxxxxxxxx>" B &&
+	test_commit -C space --author " C <c@xxxxxxxxxxx>" C &&
+	test_commit -C space --author " D  <d@xxxxxxxxxxx>" D &&
+	test_commit -C space --author "E E <e@xxxxxxxxxxx>" E &&
+	test_commit -C space --author "F  F <f@xxxxxxxxxxx>" F &&
+	test_commit -C space --author "G   G <g@xxxxxxxxxxx>" G &&
+	test_commit -C space --author "H   H <h@xxxxxxxxxxx>" H &&
+
+	test_config -C space mailmap.file ../space.map &&
+	cat >>space.map <<-\EOF &&
+	Ah <ah@xxxxxxxxxxx> < a@xxxxxxxxxxx >
+	Bee <bee@xxxxxxxxxxx  > <  b@xxxxxxxxxxx  >
+	Cee <cee@xxxxxxxxxxx> C <c@xxxxxxxxxxx>
+	dee <dee@xxxxxxxxxxx>  D  <d@xxxxxxxxxxx>
+	eee <eee@xxxxxxxxxxx> E E <e@xxxxxxxxxxx>
+	eff <eff@xxxxxxxxxxx> F  F <f@xxxxxxxxxxx>
+	gee <gee@xxxxxxxxxxx> G   G <g@xxxxxxxxxxx>
+	aitch <aitch@xxxxxxxxxxx> H  H <h@xxxxxxxxxxx>
+	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 B <b@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author C <c@xxxxxxxxxxx> maps to Cee <cee@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author D <d@xxxxxxxxxxx> maps to dee <dee@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author E E <e@xxxxxxxxxxx> maps to eee <eee@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author F  F <f@xxxxxxxxxxx> maps to eff <eff@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author G   G <g@xxxxxxxxxxx> maps to gee <gee@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+
+	Author H   H <h@xxxxxxxxxxx> maps to H   H <h@xxxxxxxxxxx>
+	Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx>
+	EOF
+	git -C space 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