Skip to content

Commit d60be8a

Browse files
stsquadgitster
authored andcommitted
send-email: add test for Linux's get_maintainer.pl
We had a regression that broke Linux's get_maintainer.pl. Using Mail::Address to parse email addresses fixed it, but let's protect against future regressions. Note that we need --cc-cmd to be relative because this option doesn't accept spaces in script names (probably to allow --cc-cmd="executable --option"), while --smtp-server needs to be absolute. Patch-edited-by: Matthieu Moy <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8f9d13 commit d60be8a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

t/t9001-send-email.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,25 @@ test_expect_success $PREREQ 'cc trailer with various syntax' '
172172
test_cmp expected-cc commandline1
173173
'
174174

175+
test_expect_success $PREREQ 'setup fake get_maintainer.pl script for cc trailer' "
176+
write_script expected-cc-script.sh <<-EOF
177+
echo 'One Person <[email protected]> (supporter:THIS (FOO/bar))'
178+
echo 'Two Person <[email protected]> (maintainer:THIS THING)'
179+
echo 'Third List <[email protected]> (moderated list:THIS THING (FOO/bar))'
180+
echo '<[email protected]> (moderated list:FOR THING)'
181+
echo '[email protected] (open list:FOR THING (FOO/bar))'
182+
echo '[email protected] (open list)'
183+
EOF
184+
"
185+
186+
test_expect_success $PREREQ 'cc trailer with get_maintainer.pl output' '
187+
clean_fake_sendmail &&
188+
git send-email -1 [email protected] \
189+
--cc-cmd=./expected-cc-script.sh \
190+
--smtp-server="$(pwd)/fake.sendmail" &&
191+
test_cmp expected-cc commandline1
192+
'
193+
175194
test_expect_success $PREREQ 'setup expect' "
176195
cat >expected-show-all-headers <<\EOF
177196
0001-Second.patch

0 commit comments

Comments
 (0)