* add test cases for RFC822 attachments, maildirs with spaces in name (do not

pass...)
This commit is contained in:
djcb 2011-11-13 12:46:55 +02:00
parent b4c32a53b7
commit 1f0517429b
4 changed files with 83 additions and 4 deletions

View File

@ -139,6 +139,8 @@ EXTRA_DIST= \
testdir2/Foo/cur/arto.eml \
testdir2/Foo/tmp/.noindex \
testdir2/Foo/new/.noindex \
testdir2/wom bat/cur/atomic \
testdir2/wom bat/cur/rfc822 \
testdir3/tree \
testdir3/tree/new \
testdir3/tree/new/.noindex \
@ -165,4 +167,3 @@ EXTRA_DIST= \
testdir3/cycle/cur/cycle0.0 \
testdir3/cycle/tmp \
testdir3/cycle/tmp/.noindex

View File

@ -47,6 +47,8 @@ fill_database (void)
" --quiet",
MU_PROGRAM,
tmpdir, MU_TESTMAILDIR2);
if (g_test_verbose())
g_print ("%s\n", cmdline);
g_assert (g_spawn_command_line_sync (cmdline, NULL, NULL,
NULL, NULL));
@ -82,7 +84,8 @@ search (const char* query, unsigned expected)
cmdline = g_strdup_printf ("%s find --muhome=%s %s",
MU_PROGRAM, muhome, query);
/* g_printerr ("%s\n", cmdline); */
if (g_test_verbose())
g_printerr ("%s\n", cmdline);
g_assert (g_spawn_command_line_sync (cmdline,
&output, &erroutput,
@ -115,7 +118,7 @@ test_mu_index (void)
store = mu_store_new_read_only (xpath, NULL);
g_assert (store);
g_assert_cmpuint (mu_store_count (store, NULL), ==, 9);
g_assert_cmpuint (mu_store_count (store, NULL), ==, 10);
mu_store_unref (store);
g_free (muhome);
@ -192,6 +195,17 @@ test_mu_find_04 (void)
}
/* some more tests */
static void
test_mu_find_05 (void)
{
/* ensure that maldirs with spaces in their names work... */
search ("subject:atoms", 1);
search ("\"maildir:/wom bat\" subject:atoms", 1);
}
static void
test_mu_extract_01 (void)
{
@ -612,6 +626,7 @@ main (int argc, char *argv[])
g_test_add_func ("/mu-cmd/test-mu-find-02", test_mu_find_02);
g_test_add_func ("/mu-cmd/test-mu-find-03", test_mu_find_03);
g_test_add_func ("/mu-cmd/test-mu-find-04", test_mu_find_04);
g_test_add_func ("/mu-cmd/test-mu-find-05", test_mu_find_05);
g_test_add_func ("/mu-cmd/test-mu-extract-01", test_mu_extract_01);
g_test_add_func ("/mu-cmd/test-mu-extract-02", test_mu_extract_02);
@ -637,4 +652,3 @@ main (int argc, char *argv[])
return rv;
}

View File

@ -0,0 +1,20 @@
Date: Sat, 12 Nov 2011 12:06:23 -0400
From: "Richard P. Feynman" <rpf@example.com>
Subject: atoms
To: "Democritus" <demo@example.com>
Message-id: <3BE9E6535E302944823E7A1A20D852173@msg.id>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Precedence: high
If, in some cataclysm, all scientific knowledge were to be destroyed,
and only one sentence passed on to the next generation of creatures,
what statement would contain the most information in the fewest words?
I believe it is the atomic hypothesis (or atomic fact, or whatever you
wish to call it) that all things are made of atoms — little particles
that move around in perpetual motion, attracting each other when they
are a little distance apart, but repelling upon being squeezed into
one another. In that one sentence you will see an enormous amount of
information about the world, if just a little imagination and thinking
are applied.

View File

@ -0,0 +1,44 @@
Return-Path: <foo@example.com>
Subject: Fwd: rfc822
From: foobar <foo@example.com>
To: martin
Content-Type: multipart/mixed; boundary="=-XHhVx/BCC6tJB87HLPqF"
Message-Id: <1077300332.871.27.camel@example.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.5
Date: Fri, 20 Feb 2004 19:05:33 +0100
--=-XHhVx/BCC6tJB87HLPqF
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hello world, forwarding some RFC822 message
--=-XHhVx/BCC6tJB87HLPqF
Content-Disposition: inline
Content-Type: message/rfc822
Return-Path: <cuux@example.com>
Message-ID: <9A01B19D0D605D478E8B72E1367C66340141B9C5@example.com>
From: frob@example.com
To: foo@example.com
Subject: hopjesvla
Date: Sat, 13 Dec 2003 19:35:56 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
The ship drew on and had safely passed the strait, which some volcanic shock
has made between the Calasareigne and Jaros islands; had doubled Pomegue, and
approached the harbor under topsails, jib, and spanker, but so slowly and
sedately that the idlers, with that instinct which is the forerunner of evil,
asked one another what misfortune could have happened on board. However, those
experienced in navigation saw plainly that if any accident had occurred, it was
not to the vessel herself, for she bore down with all the evidence of being
skilfully handled, the anchor a-cockbill, the jib-boom guys already eased off,
and standing by the side of the pilot, who was steering the Pharaon towards the
narrow entrance of the inner port, was a young man, who, with activity and
vigilant eye, watched every motion of the ship, and repeated each direction of
the pilot.
--=-XHhVx/BCC6tJB87HLPqF--