diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0206-trailers.sh')
-rwxr-xr-xtests/t0206-trailers.sh22
1 file changed, 17 insertions, 5 deletions
diff --git a/tests/t0206-trailers.sh b/tests/t0206-trailers.sh
index fe96c5a..75c59a1 100755
--- a/tests/t0206-trailers.sh
+++ b/tests/t0206-trailers.sh
@@ -4,7 +4,8 @@
# trailer block is rendered with enable-trailers on, through the exec dump
# filter as both trailer filter and email filter so the arguments each one
# receives show in the page, then with the flag off globally and off for the
-# one repository. A commit with no block is checked to get no table.
+# one repository. The repository carries a mailmap, so the sign-off idents are
+# checked to follow it. A commit with no block is checked to get no table.
test_description='Check the commit trailers table'
CGIT_TEST_NO_CREATE_REPOS=YesPlease
@@ -15,7 +16,8 @@ test_expect_success 'create a repository with a trailer-shaped message' '
(
cd repos/trailers &&
echo content >file &&
- git add file &&
+ echo "Mapped Name <mapped@example.com> <author@example.com>" >.mailmap &&
+ git add file .mailmap &&
git commit -m "plain commit" &&
echo more >>file &&
git add file &&
@@ -26,7 +28,9 @@ test_expect_success 'create a repository with a trailer-shaped message' '
Fixes: 1234567 ("plain commit")
Signed-off-by: A U Thor <author@example.com>
- Signed-off-by: C O Mitter <committer@example.com>
+ signed-off-by: C O Mitter <committer@example.com>
+ Acked-by: Some One <some@example.com> (maintainer)
+ Reported-by:
(cherry picked from commit deadbeefcafe1234)
Link: https://example.com/?a=1&b=2
EOF
@@ -55,8 +59,16 @@ test_expect_success 'a value reaches the trailer filter with its key and page' '
grep "<tr><th>Fixes</th><td>Fixes commit 1234567 (.PLAIN COMMIT.)</td></tr>" tmp
'
-test_expect_success 'a run of one key collapses into one row through the email filter' '
- grep "<tr><th>Signed-off-by</th><td><author@example.com> commit A U THOR &LT;AUTHOR@EXAMPLE.COM&GT;<br><committer@example.com> commit C O MITTER &LT;COMMITTER@EXAMPLE.COM&GT;</td></tr>" tmp
+test_expect_success 'a run of one key, whatever its case, collapses into one row' '
+ grep "<tr><th>Signed-off-by</th><td><mapped@example.com> commit MAPPED NAME &LT;MAPPED@EXAMPLE.COM&GT;<br><committer@example.com> commit C O MITTER &LT;COMMITTER@EXAMPLE.COM&GT;</td></tr>" tmp
+'
+
+test_expect_success 'an ident follows the mailmap and keeps what trails the address' '
+ grep "<tr><th>Acked-by</th><td><some@example.com> commit SOME ONE &LT;SOME@EXAMPLE.COM&GT; (maintainer)</td></tr>" tmp
+'
+
+test_expect_success 'a key with no value is printed as written' '
+ grep "<tr><td colspan=.2.>Reported-by:</td></tr>" tmp
'
test_expect_success 'a line git could not split gets a row of its own' '