]> rtime.felk.cvut.cz Git - notmuch.git/commitdiff
test: emacs mailto: URI handling
authorJameson Graef Rollins <jrollins@finestructure.net>
Sun, 29 Jan 2012 19:33:43 +0000 (11:33 -0800)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 21 Nov 2012 21:47:57 +0000 (22:47 +0100)
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

index 77265b026430d5a30d23cca426ff72153d623c5e..d372d143e8febcfbcf04458e6f7d40156e85c67f 100755 (executable)
@@ -503,6 +503,35 @@ Notmuch Test Suite <test_suite@notmuchmail.org> writes:
 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&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))"
+cat <<EOF >EXPECTED
+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--
+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\""))