X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft9001-send-email.sh;h=0b8a5915070b7064c24045d666837d996d9d4946;hb=3c7406d4b595c9e8c8dfcff2739bab9412add5a3;hp=640b3d2bb41636e271d0d55aabeade38ded612bb;hpb=b2a60953085651fe892ee20508fe2f561f0bba8f;p=git.git diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 640b3d2bb..0b8a59150 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -918,4 +918,81 @@ test_expect_success '--no-bcc overrides sendemail.bcc' ' ! grep "RCPT TO:" stdout ' +cat >email-using-8bit < +From: author@example.com +Date: Sat, 12 Jun 2010 15:53:58 +0200 +Subject: subject goes here + +Dieser deutsche Text enthält einen Umlaut! +EOF + +cat >content-type-decl <stdout && + grep "do not declare a Content-Transfer-Encoding" stdout && + grep email-using-8bit stdout && + grep "Which 8bit encoding" stdout && + grep "Content\\|MIME" msgtxt1 >actual && + test_cmp actual content-type-decl +' + +test_expect_success 'sendemail.8bitEncoding works' ' + clean_fake_sendmail && + git config sendemail.assume8bitEncoding UTF-8 && + echo bogus | + git send-email --from=author@example.com --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + email-using-8bit >stdout && + grep "Content\\|MIME" msgtxt1 >actual && + test_cmp actual content-type-decl +' + +test_expect_success '--8bit-encoding overrides sendemail.8bitEncoding' ' + clean_fake_sendmail && + git config sendemail.assume8bitEncoding "bogus too" && + echo bogus | + git send-email --from=author@example.com --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + --8bit-encoding=UTF-8 \ + email-using-8bit >stdout && + grep "Content\\|MIME" msgtxt1 >actual && + test_cmp actual content-type-decl +' + +cat >email-using-8bit < +From: author@example.com +Date: Sat, 12 Jun 2010 15:53:58 +0200 +Subject: Dieser Betreff enthält auch einen Umlaut! + +Nothing to see here. +EOF + +cat >expected <stdout && + grep "Subject" msgtxt1 >actual && + test_cmp expected actual +' + test_done