From: Miklos Vajna Date: Tue, 29 Apr 2008 10:56:47 +0000 (+0200) Subject: Add tests for sendemail.cc configuration variable X-Git-Tag: v1.5.6-rc0~58^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=33c592ddd55faa96d0f425710da5742339796b89;p=git.git Add tests for sendemail.cc configuration variable Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index c0973b4e6..af655cf52 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -166,4 +166,70 @@ test_expect_success 'second message is patch' ' grep "Subject:.*Second" msgtxt2 ' +cat >expected-show-all-headers <<\EOF +0001-Second.patch +(mbox) Adding cc: A from line 'From: A ' +Dry-OK. Log says: +Server: relay.example.com +MAIL FROM: +RCPT TO:,, +From: Example +To: to@example.com +Cc: cc@example.com, A +Subject: [PATCH 1/1] Second. +Date: DATE-STRING +Message-Id: MESSAGE-ID-STRING +X-Mailer: X-MAILER-STRING + +Result: OK +EOF + +test_expect_success 'sendemail.cc set' ' + git config sendemail.cc cc@example.com && + git send-email \ + --dry-run \ + --from="Example " \ + --to=to@example.com \ + --smtp-server relay.example.com \ + $patches | + sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \ + -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ + -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ + >actual-show-all-headers && + test_cmp expected-show-all-headers actual-show-all-headers +' + +cat >expected-show-all-headers <<\EOF +0001-Second.patch +(mbox) Adding cc: A from line 'From: A ' +Dry-OK. Log says: +Server: relay.example.com +MAIL FROM: +RCPT TO:, +From: Example +To: to@example.com +Cc: A +Subject: [PATCH 1/1] Second. +Date: DATE-STRING +Message-Id: MESSAGE-ID-STRING +X-Mailer: X-MAILER-STRING + +Result: OK +EOF + +test_expect_success 'sendemail.cc unset' ' + git config --unset sendemail.cc && + git send-email \ + --dry-run \ + --from="Example " \ + --to=to@example.com \ + --smtp-server relay.example.com \ + $patches | + sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \ + -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ + -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ + >actual-show-all-headers && + test_cmp expected-show-all-headers actual-show-all-headers +' + test_done