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

Jameson Graef Rollins jrollins at finestructure.net
Sun Jan 29 11:33:43 PST 2012


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 at notmuchmail.org> w
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "Compose to \"mailto:\" URI"
+test_subtest_known_broken
+# 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&subject=last%20call%20for%20cats%20%26%20dogs%2E&subject=You%20should%20not%20see%20me%2E&body=line1%0D%0Aline2&body=line3&body=line4%0D%0AColumn1A%09Column1B%09Column1C%09Column1D%0D%0A%E2%88%9A&cc=cc1%40example.net%2C%20cc2%40example.net&to=to5%40example.net%2C%20to6%40example.net&foo=IGNORE&bcc=bcc1%40example.net%2C%20bcc2%40example.net&bcc=bcc3%40example.net%2C%20bcc4%40example.net&in-reply-to=<orig1 at example.net>\")
+		  (notmuch-fcc-dirs nil))
+	      (notmuch-mua-mailto mailto)
+	      (test-output))"
+cat <<EOF >EXPECTED
+From: Notmuch Test Suite <test_suite at notmuchmail.org>
+To: to1 at example.net, to2 at example.net, to3 at example.net, to4 at example.net
+Cc: cc1 at example.net, cc2 at example.net
+Subject: last call for cats & dogs.
+In-Reply-To: <orig1 at example.net>
+Bcc: bcc1 at example.net, bcc2 at example.net
+--text follows this line--
+line1
+line2
+line3
+line4
+Column1A	Column1B	Column1C	Column1D
+√
+EOF
+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\""))
-- 
1.7.8.3



More information about the notmuch mailing list