Skip to content

Commit

Permalink
mailinfo: tests for RFC2047 examples
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kirill Smelkov authored and Junio C Hamano committed Jan 29, 2009
1 parent 806d5e9 commit c32815f
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 0 deletions.
22 changes: 22 additions & 0 deletions t/t5100-mailinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
Empty file added t/t5100/empty
Empty file.
4 changes: 4 additions & 0 deletions t/t5100/rfc2047-info-0001
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Author: Keith Moore
Email: moore@cs.utk.edu
Subject: If you can read this you understand the example.

4 changes: 4 additions & 0 deletions t/t5100/rfc2047-info-0002
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Author: Olle Järnefors
Email: ojarnef@admin.kth.se
Subject: Time for ISO 10646?

4 changes: 4 additions & 0 deletions t/t5100/rfc2047-info-0003
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Author: Patrik Fältström
Email: paf@nada.kth.se
Subject: RFC-HDR care and feeding

4 changes: 4 additions & 0 deletions t/t5100/rfc2047-info-0004
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Author: Nathaniel Borenstein (םולש ןב ילטפנ)
Email: nsb@thumper.bellcore.com
Subject: Test of new header generator

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0005
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (a)

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0006
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (a b)

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0007
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (ab)

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0008
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (ab)

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0009
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (ab)

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0010
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (a b)

2 changes: 2 additions & 0 deletions t/t5100/rfc2047-info-0011
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subject: (a b)

48 changes: 48 additions & 0 deletions t/t5100/rfc2047-samples.mbox
Original file line number Diff line number Diff line change
@@ -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?=)

0 comments on commit c32815f

Please sign in to comment.