t3102: style modernization
[gitweb.git] / t / t5100-mailinfo.sh
index ebc36c1758372f484055b62080d3ce81ae7c69b4..9e1ad1ca21341d449fa3ab1b896a899e51272127 100755 (executable)
@@ -11,7 +11,7 @@ test_expect_success 'split sample box' \
        'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
        last=`cat last` &&
        echo total is $last &&
-       test `cat last` = 16'
+       test `cat last` = 17'
 
 check_mailinfo () {
        mail=$1 opt=$2
@@ -65,7 +65,7 @@ test_expect_success 'respect NULs' '
        git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
        test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
        (cat 001 | git mailinfo msg patch) &&
-       test 4 = $(wc -l < patch)
+       test_line_count = 4 patch
 
 '
 
@@ -89,4 +89,22 @@ test_expect_success 'mailinfo on from header without name works' '
 
 '
 
+test_expect_success 'mailinfo finds headers after embedded From line' '
+       mkdir embed-from &&
+       git mailsplit -oembed-from "$TEST_DIRECTORY"/t5100/embed-from.in &&
+       test_cmp "$TEST_DIRECTORY"/t5100/embed-from.in embed-from/0001 &&
+       git mailinfo embed-from/msg embed-from/patch \
+         <embed-from/0001 >embed-from/out &&
+       test_cmp "$TEST_DIRECTORY"/t5100/embed-from.expect embed-from/out
+'
+
+test_expect_success 'mailinfo on message with quoted >From' '
+       mkdir quoted-from &&
+       git mailsplit -oquoted-from "$TEST_DIRECTORY"/t5100/quoted-from.in &&
+       test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.in quoted-from/0001 &&
+       git mailinfo quoted-from/msg quoted-from/patch \
+         <quoted-from/0001 >quoted-from/out &&
+       test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.expect quoted-from/msg
+'
+
 test_done