Skip to content

Commit 9e2a14a

Browse files
avargitster
authored andcommitted
mailmap tests: add tests for whitespace syntax
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9b391b0 commit 9e2a14a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

t/t4203-mailmap.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,4 +786,56 @@ test_expect_success 'comment syntax: setup' '
786786
test_cmp expect actual
787787
'
788788

789+
test_expect_success 'whitespace syntax: setup' '
790+
test_create_repo space &&
791+
test_commit -C space --author "A <[email protected]>" A &&
792+
test_commit -C space --author "B <[email protected]>" B &&
793+
test_commit -C space --author " C <[email protected]>" C &&
794+
test_commit -C space --author " D <[email protected]>" D &&
795+
test_commit -C space --author "E E <[email protected]>" E &&
796+
test_commit -C space --author "F F <[email protected]>" F &&
797+
test_commit -C space --author "G G <[email protected]>" G &&
798+
test_commit -C space --author "H H <[email protected]>" H &&
799+
800+
test_config -C space mailmap.file ../space.map &&
801+
cat >>space.map <<-\EOF &&
802+
803+
804+
805+
806+
807+
808+
809+
810+
EOF
811+
812+
cat >expect <<-\EOF &&
813+
Author A <[email protected]> maps to A <[email protected]>
814+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
815+
816+
Author B <[email protected]> maps to B <[email protected]>
817+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
818+
819+
Author C <[email protected]> maps to Cee <[email protected]>
820+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
821+
822+
Author D <[email protected]> maps to dee <[email protected]>
823+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
824+
825+
Author E E <[email protected]> maps to eee <[email protected]>
826+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
827+
828+
Author F F <[email protected]> maps to eff <[email protected]>
829+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
830+
831+
Author G G <[email protected]> maps to gee <[email protected]>
832+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
833+
834+
Author H H <[email protected]> maps to H H <[email protected]>
835+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
836+
EOF
837+
git -C space log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
838+
test_cmp expect actual
839+
'
840+
789841
test_done

0 commit comments

Comments
 (0)