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>
This commit is contained in:
Kirill Smelkov 2009-01-13 01:21:04 +03:00 committed by Junio C Hamano
parent 806d5e9044
commit c32815f903
14 changed files with 100 additions and 0 deletions

View file

@ -25,6 +25,28 @@ do
diff ../t5100/info$mail info$mail"
done
test_expect_success 'split box with rfc2047 samples' \
'mkdir rfc2047 &&
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
>rfc2047/last &&
last=`cat rfc2047/last` &&
echo total is $last &&
test `cat rfc2047/last` = 11'
for mail in `echo rfc2047/00*`
do
test_expect_success "mailinfo $mail" '
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
echo msg &&
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
echo patch &&
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
echo info &&
test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
'
done
test_expect_success 'respect NULs' '
git mailsplit -d3 -o. ../t5100/nul-plain &&

0
t/t5100/empty Normal file
View file

View file

@ -0,0 +1,4 @@
Author: Keith Moore
Email: moore@cs.utk.edu
Subject: If you can read this you understand the example.

View file

@ -0,0 +1,4 @@
Author: Olle Järnefors
Email: ojarnef@admin.kth.se
Subject: Time for ISO 10646?

View file

@ -0,0 +1,4 @@
Author: Patrik Fältström
Email: paf@nada.kth.se
Subject: RFC-HDR care and feeding

View file

@ -0,0 +1,4 @@
Author: Nathaniel Borenstein (םולש ןב ילטפנ)
Email: nsb@thumper.bellcore.com
Subject: Test of new header generator

View file

@ -0,0 +1,2 @@
Subject: (a)

View file

@ -0,0 +1,2 @@
Subject: (a b)

View file

@ -0,0 +1,2 @@
Subject: (ab)

View file

@ -0,0 +1,2 @@
Subject: (ab)

View file

@ -0,0 +1,2 @@
Subject: (ab)

View file

@ -0,0 +1,2 @@
Subject: (a b)

View file

@ -0,0 +1,2 @@
Subject: (a b)

View file

@ -0,0 +1,48 @@
From nobody Mon Sep 17 00:00:00 2001
From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
From nobody Mon Sep 17 00:00:00 2001
From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>
To: ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se
Subject: Time for ISO 10646?
From nobody Mon Sep 17 00:00:00 2001
To: Dave Crocker <dcrocker@mordor.stanford.edu>
Cc: ietf-822@dimacs.rutgers.edu, paf@comsol.se
From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>
Subject: Re: RFC-HDR care and feeding
From nobody Mon Sep 17 00:00:00 2001
From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
(=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
To: Greg Vaudreuil <gvaudre@NRI.Reston.VA.US>, Ned Freed
<ned@innosoft.com>, Keith Moore <moore@cs.utk.edu>
Subject: Test of new header generator
MIME-Version: 1.0
Content-type: text/plain; charset=ISO-8859-1
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= b)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?=
=?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a_b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)