From: Tom Russello <[email protected]> Tests if the "To", "Cc" and "Subject" fields are adequately filled and if the message is correctly quoted.
Signed-off-by: Tom Russello <[email protected]> Signed-off-by: Samuel Groot <[email protected]> Signed-off-by: Matthieu Moy <[email protected]> --- diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index b3355d2..bda4018 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -1885,4 +1885,47 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' ' test_cmp expected-list actual-list ' +test_expect_success $PREREQ 'setup expect' ' + cat >email <<-\EOF + Message-Id: <[email protected]> + From: [email protected] + To: [email protected] + Cc: [email protected] + Date: Sat, 12 Jun 2010 15:53:58 +0200 + Subject: subject goes here + + Have you seen my previous email? + > Previous content + EOF +' + +test_expect_success $PREREQ 'From, To, Cc, Subject with --quote-mail are correct' ' + clean_fake_sendmail && + git send-email \ + --quote-mail=email \ + --from="Example <[email protected]>" \ + --smtp-server="$(pwd)/fake.sendmail" \ + -1 \ + 2>errors && + grep "From: Example <[email protected]>" msgtxt1 && + to_adr=$(awk "/^To: /,/^Cc: /" msgtxt1) && + echo "$to_adr" | grep [email protected] && + echo "$to_adr" | grep [email protected] && + grep "Cc: [email protected]" msgtxt1 +' +test_expect_success $PREREQ 'the message given is quoted with --quote-mail' ' + grep "> Have you seen my previous email?" msgtxt1 && + grep ">> Previous content" msgtxt1 +' +test_expect_success $PREREQ 'Check if Re is written, only once with --quote-mail' ' + grep "Subject: Re: subject goes here" msgtxt1 && + git send-email \ + --quote-mail=msgtxt1 \ + --from="Example <[email protected]>" \ + --smtp-server="$(pwd)/fake.sendmail" \ + -1 \ + 2>errors && + grep "Subject: Re: subject goes here" msgtxt3 +' + test_done -- 2.8.2 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

