Skip to content

Commit c32815f

Browse files
navytuxgitster
authored andcommitted
mailinfo: tests for RFC2047 examples
Also as suggested by Junio, in order to try to catch other MIME problems, test cases from the "8. Examples" section of RFC2047 are added to t5100 testsuite as well. Signed-off-by: Kirill Smelkov <[email protected]>
1 parent 806d5e9 commit c32815f

14 files changed

+100
-0
lines changed

t/t5100-mailinfo.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,28 @@ do
2525
diff ../t5100/info$mail info$mail"
2626
done
2727

28+
29+
test_expect_success 'split box with rfc2047 samples' \
30+
'mkdir rfc2047 &&
31+
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
32+
>rfc2047/last &&
33+
last=`cat rfc2047/last` &&
34+
echo total is $last &&
35+
test `cat rfc2047/last` = 11'
36+
37+
for mail in `echo rfc2047/00*`
38+
do
39+
test_expect_success "mailinfo $mail" '
40+
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
41+
echo msg &&
42+
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
43+
echo patch &&
44+
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
45+
echo info &&
46+
test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
47+
'
48+
done
49+
2850
test_expect_success 'respect NULs' '
2951
3052
git mailsplit -d3 -o. ../t5100/nul-plain &&

t/t5100/empty

Whitespace-only changes.

t/t5100/rfc2047-info-0001

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Author: Keith Moore
2+
3+
Subject: If you can read this you understand the example.
4+

t/t5100/rfc2047-info-0002

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Author: Olle Järnefors
2+
3+
Subject: Time for ISO 10646?
4+

t/t5100/rfc2047-info-0003

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Author: Patrik Fältström
2+
3+
Subject: RFC-HDR care and feeding
4+

t/t5100/rfc2047-info-0004

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Author: Nathaniel Borenstein (םולש ןב ילטפנ)
2+
3+
Subject: Test of new header generator
4+

t/t5100/rfc2047-info-0005

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Subject: (a)
2+

t/t5100/rfc2047-info-0006

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Subject: (a b)
2+

t/t5100/rfc2047-info-0007

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Subject: (ab)
2+

t/t5100/rfc2047-info-0008

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Subject: (ab)
2+

0 commit comments

Comments
 (0)