@matheusbsbs / matheus-bagliano / commits / c32815f903
Fork 0

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 <kirr@landau.phys.spbu.ru>

Kirill Smelkov committed Jan 13, 2009 at 01:21 UTC c32815f903f50a44006f6d12da11492141e70d73
14 files changed +100
t/t5100-mailinfo.sh
+22
@@ -25,6 +25,28 @@ do
25 diff ../t5100/info$mail info$mail"
26 done
27
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 +
50 test_expect_success 'respect NULs' '
51
52 git mailsplit -d3 -o. ../t5100/nul-plain &&
t/t5100/empty
t/t5100/rfc2047-info-0001 new
+4
@@ -0,0 +1,4 @@
1 +Author: Keith Moore
2 +Email: moore@cs.utk.edu
3 +Subject: If you can read this you understand the example.
4 +
t/t5100/rfc2047-info-0002 new
+4
@@ -0,0 +1,4 @@
1 +Author: Olle Järnefors
2 +Email: ojarnef@admin.kth.se
3 +Subject: Time for ISO 10646?
4 +
t/t5100/rfc2047-info-0003 new
+4
@@ -0,0 +1,4 @@
1 +Author: Patrik Fältström
2 +Email: paf@nada.kth.se
3 +Subject: RFC-HDR care and feeding
4 +
t/t5100/rfc2047-info-0004 new
+4
@@ -0,0 +1,4 @@
1 +Author: Nathaniel Borenstein (םולש ןב ילטפנ)
2 +Email: nsb@thumper.bellcore.com
3 +Subject: Test of new header generator
4 +
t/t5100/rfc2047-info-0005 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (a)
2 +
t/t5100/rfc2047-info-0006 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (a b)
2 +
t/t5100/rfc2047-info-0007 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (ab)
2 +
t/t5100/rfc2047-info-0008 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (ab)
2 +
t/t5100/rfc2047-info-0009 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (ab)
2 +
t/t5100/rfc2047-info-0010 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (a b)
2 +
t/t5100/rfc2047-info-0011 new
+2
@@ -0,0 +1,2 @@
1 +Subject: (a b)
2 +
t/t5100/rfc2047-samples.mbox new
+48
@@ -0,0 +1,48 @@
1 +From nobody Mon Sep 17 00:00:00 2001
2 +From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>
3 +To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
4 +CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
5 +Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
6 + =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
7 +
8 +From nobody Mon Sep 17 00:00:00 2001
9 +From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>
10 +To: ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se
11 +Subject: Time for ISO 10646?
12 +
13 +From nobody Mon Sep 17 00:00:00 2001
14 +To: Dave Crocker <dcrocker@mordor.stanford.edu>
15 +Cc: ietf-822@dimacs.rutgers.edu, paf@comsol.se
16 +From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>
17 +Subject: Re: RFC-HDR care and feeding
18 +
19 +From nobody Mon Sep 17 00:00:00 2001
20 +From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
21 + (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
22 +To: Greg Vaudreuil <gvaudre@NRI.Reston.VA.US>, Ned Freed
23 + <ned@innosoft.com>, Keith Moore <moore@cs.utk.edu>
24 +Subject: Test of new header generator
25 +MIME-Version: 1.0
26 +Content-type: text/plain; charset=ISO-8859-1
27 +
28 +From nobody Mon Sep 17 00:00:00 2001
29 +Subject: (=?ISO-8859-1?Q?a?=)
30 +
31 +From nobody Mon Sep 17 00:00:00 2001
32 +Subject: (=?ISO-8859-1?Q?a?= b)
33 +
34 +From nobody Mon Sep 17 00:00:00 2001
35 +Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
36 +
37 +From nobody Mon Sep 17 00:00:00 2001
38 +Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
39 +
40 +From nobody Mon Sep 17 00:00:00 2001
41 +Subject: (=?ISO-8859-1?Q?a?=
42 + =?ISO-8859-1?Q?b?=)
43 +
44 +From nobody Mon Sep 17 00:00:00 2001
45 +Subject: (=?ISO-8859-1?Q?a_b?=)
46 +
47 +From nobody Mon Sep 17 00:00:00 2001
48 +Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)