Skip to content

Commit cb5c952

Browse files
sunshinecogitster
authored andcommitted
t4203: test check-mailmap command invocation
Test the command-line interface of check-mailmap. (Actual .mailmap functionality is already covered by existing tests.) Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 226ad34 commit cb5c952

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

t/t4203-mailmap.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ fuzz_blame () {
1313
}
1414

1515
test_expect_success setup '
16+
cat >contacts <<-\EOF &&
17+
A U Thor <[email protected]>
18+
19+
EOF
20+
1621
echo one >one &&
1722
git add one &&
1823
test_tick &&
@@ -23,6 +28,44 @@ test_expect_success setup '
2328
git commit --author "nick1 <[email protected]>" -m second
2429
'
2530

31+
test_expect_success 'check-mailmap no arguments' '
32+
test_must_fail git check-mailmap
33+
'
34+
35+
test_expect_success 'check-mailmap arguments' '
36+
cat >expect <<-\EOF &&
37+
A U Thor <[email protected]>
38+
39+
EOF
40+
git check-mailmap \
41+
"A U Thor <[email protected]>" \
42+
"nick1 <[email protected]>" >actual &&
43+
test_cmp expect actual
44+
'
45+
46+
test_expect_success 'check-mailmap --stdin' '
47+
cat >expect <<-\EOF &&
48+
A U Thor <[email protected]>
49+
50+
EOF
51+
git check-mailmap --stdin <contacts >actual &&
52+
test_cmp expect actual
53+
'
54+
55+
test_expect_success 'check-mailmap --stdin arguments' '
56+
cat >expect <<-\EOF &&
57+
Internal Guy <[email protected]>
58+
EOF
59+
cat <contacts >>expect &&
60+
git check-mailmap --stdin "Internal Guy <[email protected]>" \
61+
<contacts >actual &&
62+
test_cmp expect actual
63+
'
64+
65+
test_expect_success 'check-mailmap bogus contact' '
66+
test_must_fail git check-mailmap bogus
67+
'
68+
2669
cat >expect <<\EOF
2770
A U Thor (1):
2871
initial

0 commit comments

Comments
 (0)