X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Femacs;h=5d118b67b4d347ae34242ba36cdc0051c2ebd799;hp=8a28705873c5299c099399a9d0e4b79414901eed;hb=e01706c99375f3e3f121cf372a45a752874fd38a;hpb=2ee1d8e1c70ce20728bc3faada389a4802636352 diff --git a/test/emacs b/test/emacs index 8a287058..5d118b67 100755 --- a/test/emacs +++ b/test/emacs @@ -35,11 +35,21 @@ test_emacs '(notmuch-search "tag:inbox") (test-output)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox +test_begin_subtest "Incremental parsing of search results" +test_emacs "(ad-enable-advice 'notmuch-search-process-filter 'around 'pessimal) + (ad-activate 'notmuch-search-process-filter) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (ad-disable-advice 'notmuch-search-process-filter 'around 'pessimal) + (ad-activate 'notmuch-search-process-filter) + (test-output)" +test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox + test_begin_subtest "Navigation of notmuch-hello to search results" test_emacs '(notmuch-hello) (goto-char (point-min)) (re-search-forward "inbox") - (widget-button-press (point)) + (widget-button-press (1- (point))) (notmuch-test-wait) (test-output)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox @@ -139,6 +149,17 @@ test_emacs '(notmuch-search "id:\"123..456@example\"") output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)" +test_begin_subtest "Message with quote in Message-Id:" +add_message '[id]="\"quote\"@example"' '[subject]="Message with quote in Message-Id"' +test_emacs '(notmuch-search "subject:\"Message with quote\"") + (notmuch-test-wait) + (execute-kbd-macro "+search-add") + (notmuch-search-show-thread) + (notmuch-test-wait) + (execute-kbd-macro "+show-add")' +output=$(notmuch search 'id:"""quote""@example"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with quote in Message-Id (inbox search-add show-add)" + test_begin_subtest "Sending a message via (fake) SMTP" emacs_deliver_message \ 'Testing message sent via SMTP' \ @@ -148,7 +169,8 @@ emacs_deliver_message \ (insert "To: user@example.com\n")' sed \ -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \ - -e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message >OUTPUT + -e s',^Message-ID: <.*>$,Message-ID: ,' \ + -e s',^\(Content-Type: text/plain\); charset=us-ascii$,\1,' < sent_message >OUTPUT cat <EXPECTED From: Notmuch Test Suite To: user@example.com @@ -157,7 +179,7 @@ Date: 01 Jan 2000 12:00:00 -0000 User-Agent: Notmuch/XXX Emacs/XXX Message-ID: MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii +Content-Type: text/plain This is a test that messages are sent via SMTP EOF @@ -256,17 +278,22 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply within emacs" -test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"") +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-search "subject:\"testing message sent via SMTP\"") (notmuch-test-wait) (notmuch-search-reply-to-thread) - (test-output)' + (test-output))' sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: /' OUTPUT +sed -i -e 's/^References: <.*>$/References: /' OUTPUT +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: user@example.com Subject: Re: Testing message sent via SMTP In-Reply-To: Fcc: ${MAIL_DIR}/sent +References: +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Notmuch Test Suite writes: @@ -274,16 +301,71 @@ Notmuch Test Suite writes: EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "Reply from alternate address within emacs" +add_message '[from]="Sender "' \ + [to]=test_suite_other@notmuchmail.org + +test_emacs "(let ((message-hidden-headers '())) + (notmuch-search \"id:\\\"${gen_msg_id}\\\"\") + (notmuch-test-wait) + (notmuch-search-reply-to-thread) + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT +cat <EXPECTED +From: Notmuch Test Suite +To: Sender +Subject: Re: ${test_subtest_name} +In-Reply-To: <${gen_msg_id}> +Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +User-Agent: Notmuch/XXX Emacs/XXX +--text follows this line-- +Sender writes: + +> This is just a test message (#${gen_msg_cnt}) +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "Reply from address in named group list within emacs" +add_message '[from]="Sender "' \ + '[to]=group:test_suite@notmuchmail.org,someone@example.com\;' \ + [cc]=test_suite_other@notmuchmail.org + +test_emacs "(let ((message-hidden-headers '())) + (notmuch-search \"id:\\\"${gen_msg_id}\\\"\") + (notmuch-test-wait) + (notmuch-search-reply-to-thread) + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT +cat <EXPECTED +From: Notmuch Test Suite +To: Sender , someone@example.com +Subject: Re: ${test_subtest_name} +In-Reply-To: <${gen_msg_id}> +Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +User-Agent: Notmuch/XXX Emacs/XXX +--text follows this line-- +Sender writes: + +> This is just a test message (#${gen_msg_cnt}) +EOF +test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "Reply within emacs to a multipart/mixed message" -test_emacs '(notmuch-show "id:20091118002059.067214ed@hikari") +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-show "id:20091118002059.067214ed@hikari") (notmuch-show-reply) - (test-output)' + (test-output))' +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Adrian Perez de Castro , notmuch@notmuchmail.org Subject: Re: [notmuch] Introducing myself In-Reply-To: <20091118002059.067214ed@hikari> Fcc: ${MAIL_DIR}/sent +References: <20091118002059.067214ed@hikari> +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Adrian Perez de Castro writes: @@ -334,15 +416,19 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply within emacs to a multipart/alternative message" -test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-reply) - (test-output)' + (test-output))' +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Alex Botero-Lowry , notmuch@notmuchmail.org Subject: Re: [notmuch] preliminary FreeBSD support In-Reply-To: Fcc: ${MAIL_DIR}/sent +References: +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Alex Botero-Lowry writes: @@ -369,20 +455,47 @@ Alex Botero-Lowry writes: EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "Reply within emacs to an html-only message" +add_message '[content-type]="text/html"' \ + '[body]="Hi,
This is an HTML test message.

OK?"' +test_emacs "(let ((message-hidden-headers '()) (mm-text-html-renderer 'html2text)) + (notmuch-show \"id:${gen_msg_id}\") + (notmuch-show-reply) + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT +cat <EXPECTED +From: Notmuch Test Suite +To: +Subject: Re: Reply within emacs to an html-only message +In-Reply-To: <${gen_msg_id}> +Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +User-Agent: Notmuch/XXX Emacs/XXX +--text follows this line-- +Notmuch Test Suite writes: + +> Hi,This is an HTML test message.OK? +EOF +test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "Quote MML tags in reply" message_id='test-emacs-mml-quoting@message.id' add_message [id]="$message_id" \ "[subject]='$test_subtest_name'" \ '[body]="<#part disposition=inline>"' -test_emacs "(notmuch-show \"id:$message_id\") +test_emacs "(let ((message-hidden-headers '())) + (notmuch-show \"id:$message_id\") (notmuch-show-reply) - (test-output)" + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Subject: Re: Quote MML tags in reply In-Reply-To: Fcc: ${MAIL_DIR}/sent +References: +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Notmuch Test Suite writes: