do_for_each_reflog(): use a strbuf to hold logfile name
[gitweb.git] / t / t5100-mailinfo.sh
index e70ea94a1368dc045469808d30c717aa2b8bb158..81904d9ec8d341399b534c5d576262439d0e1ad6 100755 (executable)
@@ -11,18 +11,30 @@ 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` = 13'
+       test `cat last` = 16'
+
+check_mailinfo () {
+       mail=$1 opt=$2
+       mo="$mail$opt"
+       git mailinfo -u $opt msg$mo patch$mo <$mail >info$mo &&
+       test_cmp "$TEST_DIRECTORY"/t5100/msg$mo msg$mo &&
+       test_cmp "$TEST_DIRECTORY"/t5100/patch$mo patch$mo &&
+       test_cmp "$TEST_DIRECTORY"/t5100/info$mo info$mo
+}
+
 
 for mail in `echo 00*`
 do
        test_expect_success "mailinfo $mail" '
-               git mailinfo -u msg$mail patch$mail <$mail >info$mail &&
-               echo msg &&
-               test_cmp "$TEST_DIRECTORY"/t5100/msg$mail msg$mail &&
-               echo patch &&
-               test_cmp "$TEST_DIRECTORY"/t5100/patch$mail patch$mail &&
-               echo info &&
-               test_cmp "$TEST_DIRECTORY"/t5100/info$mail info$mail
+               check_mailinfo $mail "" &&
+               if test -f "$TEST_DIRECTORY"/t5100/msg$mail--scissors
+               then
+                       check_mailinfo $mail --scissors
+               fi &&
+               if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
+               then
+                       check_mailinfo $mail --no-inbody-headers
+               fi
        '
 done
 
@@ -53,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
 
 '