[RFC-PATCH 2/2] t9001: adding --quote-mail option test
- From
- Tom Russello <tom.russello@grenoble-inp.org>
- Date
- May 23, 2016, 19:30 UTC
- Message-ID
- <1464031829-6107-3-git-send-email-tom.russello@grenoble-inp.org>
- In-Reply-To
- <1464031829-6107-1-git-send-email-tom.russello@grenoble-inp.org>
From: Tom Russello <tom.russello@ensimag.grenoble-inp.fr>
Tests if the "To", "Cc" and "Subject" fields are adequately filled and if the message is correctly quoted.
Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org> Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
---
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: <author_123456@example.com> + From: author@example.com + To: to1@example.com + Cc: cc1@example.com + 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 <nobody@example.com>" \ + --smtp-server="$(pwd)/fake.sendmail" \ + -1 \ + 2>errors && + grep "From: Example <nobody@example.com>" msgtxt1 && + to_adr=$(awk "/^To: /,/^Cc: /" msgtxt1) && + echo "$to_adr" | grep author@example.com && + echo "$to_adr" | grep to1@example.com && + grep "Cc: cc1@example.com" 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 <nobody@example.com>" \ + --smtp-server="$(pwd)/fake.sendmail" \ + -1 \ + 2>errors && + grep "Subject: Re: subject goes here" msgtxt3 +' + test_done
-- 2.8.2