Merge branch 'js/t0001-case-insensitive' into maint
[gitweb.git] / t / t9001-send-email.sh
index b8e919e25d6b4def87a6d66db32b94e8813b1cd7..1e3ac3c3846342ac84baa096ab00ed602e4cdf27 100755 (executable)
@@ -253,10 +253,9 @@ test_suppress_self () {
 
        mv msgtxt1 msgtxt1-$3 &&
        sed -e '/^$/q' msgtxt1-$3 >"msghdr1-$3" &&
-       >"expected-no-cc-$3" &&
 
        (grep '^Cc:' msghdr1-$3 >"actual-no-cc-$3";
-        test_cmp expected-no-cc-$3 actual-no-cc-$3)
+        test_must_be_empty actual-no-cc-$3)
 }
 
 test_suppress_self_unquoted () {
@@ -482,6 +481,20 @@ test_expect_success $PREREQ 'long lines with auto encoding are quoted-printable'
        grep "Content-Transfer-Encoding: quoted-printable" msgtxt1
 '
 
+test_expect_success $PREREQ 'carriage returns with auto encoding are quoted-printable' '
+       clean_fake_sendmail &&
+       cp $patches cr.patch &&
+       printf "this is a line\r\n" >>cr.patch &&
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               --transfer-encoding=auto \
+               --no-validate \
+               cr.patch &&
+       grep "Content-Transfer-Encoding: quoted-printable" msgtxt1
+'
+
 for enc in auto quoted-printable base64
 do
        test_expect_success $PREREQ "--validate passes with encoding $enc" '
@@ -493,6 +506,21 @@ do
                        --validate \
                        $patches longline.patch
        '
+
+done
+
+for enc in 7bit 8bit quoted-printable base64
+do
+       test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" '
+               clean_fake_sendmail &&
+               git send-email \
+                       --from="Example <nobody@example.com>" \
+                       --to=nobody@example.com \
+                       --smtp-server="$(pwd)/fake.sendmail" \
+                       --transfer-encoding=$enc \
+                       $patches &&
+               grep "Content-Transfer-Encoding: $enc" msgtxt1
+       '
 done
 
 test_expect_success $PREREQ 'Invalid In-Reply-To' '