[PATCH] send-email: add test for Linux's get_maintainer.pl

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

 



From: Alex Bennée <alex.bennee@xxxxxxxxxx>

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.

Patch-edited-by: Matthieu Moy <git@xxxxxxxxxxxxxxx>
Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx>
Signed-off-by: Matthieu Moy <git@xxxxxxxxxxxxxxx>
---
 t/t9001-send-email.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 4d261c2..f126177 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -172,6 +172,28 @@ test_expect_success $PREREQ 'cc trailer with various syntax' '
 	test_cmp expected-cc commandline1
 '
 
+test_expect_success $PREREQ 'setup fake get_maintainer.pl script for cc trailer' "
+	cat >expected-cc-script.sh <<-EOF &&
+	#!/bin/sh
+	echo 'One Person <one@xxxxxxxxxxx> (supporter:THIS (FOO/bar))'
+	echo 'Two Person <two@xxxxxxxxxxx> (maintainer:THIS THING)'
+	echo 'Third List <three@xxxxxxxxxxx> (moderated list:THIS THING (FOO/bar))'
+	echo '<four@xxxxxxxxxxx> (moderated list:FOR THING)'
+	echo 'five@xxxxxxxxxxx (open list:FOR THING (FOO/bar))'
+	echo 'six@xxxxxxxxxxx (open list)'
+	EOF
+	chmod +x expected-cc-script.sh
+"
+
+test_expect_success $PREREQ 'cc trailer with get_maintainer.pl output' '
+	test_commit cc-trailer-getmaint &&
+	clean_fake_sendmail &&
+	git send-email -1 --to=recipient@xxxxxxxxxxx \
+		--cc-cmd="./expected-cc-script.sh" \
+		--smtp-server="$(pwd)/fake.sendmail" &&
+	test_cmp expected-cc commandline1
+'
+
 test_expect_success $PREREQ 'setup expect' "
 cat >expected-show-all-headers <<\EOF
 0001-Second.patch
-- 
2.7.4




[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