[PATCH 1/2] test: emacs mailto: URI handling

Subject: [PATCH 1/2] test: emacs mailto: URI handling

Date: Sun, 29 Jan 2012 11:33:43 -0800

To: Notmuch Mail


From: Jameson Graef Rollins

This adds a test for proposed rfc6068 "mailto:" URI handling.  The
proposed function would be called 'notmuch-mua-mailto'.  The test
provides an example mailto: string that should test some subset of the
rfc6068 specification: http://tools.ietf.org/html/rfc6068
 test/emacs |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/test/emacs b/test/emacs
index 8ca4c8a..c6afa14 100755
--- a/test/emacs
+++ b/test/emacs
@@ -273,6 +273,35 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> w
 test_expect_equal_file OUTPUT EXPECTED
+test_begin_subtest "Compose to \"mailto:\" URI"
+# This *should* test the ability to parse rfc6068 "mailto:" URIs:
+# http://tools.ietf.org/html/rfc6068
+# this test is based on:
+# http://shadow2531.com/opera/testcases/mailto/rfc2368-0.html
+# which is itself based on the precursor rfc2368, so it could probably
+# be updated.
+test_emacs "(let ((mailto \"mailto:to1%40example.net%2C%20to2%40example.net?to=to3%40example.net%2C%20to4%40example.net&amp;subject=last%20call%20for%20cats%20%26%20dogs%2E&amp;subject=You%20should%20not%20see%20me%2E&amp;body=line1%0D%0Aline2&amp;body=line3&amp;body=line4%0D%0AColumn1A%09Column1B%09Column1C%09Column1D%0D%0A%E2%88%9A&amp;cc=cc1%40example.net%2C%20cc2%40example.net&amp;to=to5%40example.net%2C%20to6%40example.net&amp;foo=IGNORE&amp;bcc=bcc1%40example.net%2C%20bcc2%40example.net&amp;bcc=bcc3%40example.net%2C%20bcc4%40example.net&amp;in-reply-to=<orig1@example.net>\")
+		  (notmuch-fcc-dirs nil))
+	      (notmuch-mua-mailto mailto)
+	      (test-output))"
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: to1@example.net, to2@example.net, to3@example.net, to4@example.net
+Cc: cc1@example.net, cc2@example.net
+Subject: last call for cats & dogs.
+In-Reply-To: <orig1@example.net>
+Bcc: bcc1@example.net, bcc2@example.net
+--text follows this line--
+Column1A	Column1B	Column1C	Column1D
+test_expect_equal_file OUTPUT EXPECTED
 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"
 # save as archive to test that Emacs does not re-compress .gz
 test_emacs '(let ((standard-input "\"attachment1.gz\""))