From 7123e63b00c2e47c70c07967c98fa1d97a1c5870 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 27 Oct 2010 17:06:26 -0700 Subject: [PATCH] test: Use an explicit date in the message sent via (fake) SMTP Simply setting an explicit date is cleaner than letting the current, (arbitrary), date get generated for the email message and then constantly filtering that date out of search results. --- test/emacs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/emacs b/test/emacs index 2db8542a..6fab3003 100755 --- a/test/emacs +++ b/test/emacs @@ -65,18 +65,17 @@ mkdir -p mail/sent/tmp ../smtp-dummy sent_message & smtp_dummy_pid=$! -test_emacs "(setq message-send-mail-function 'message-smtpmail-send-it) (setq smtpmail-smtp-server \"localhost\") (setq smtpmail-smtp-service \"25025\") (notmuch-hello) (notmuch-mua-mail) (message-goto-to) (insert \"user@example.com\") (message-goto-subject) (insert \"Testing message sent via SMTP\") (message-goto-body) (insert \"This is a test that messages are sent via SMTP\") (message-send-and-exit)" >/dev/null 2>&1 +test_emacs "(setq message-send-mail-function 'message-smtpmail-send-it) (setq smtpmail-smtp-server \"localhost\") (setq smtpmail-smtp-service \"25025\") (notmuch-hello) (notmuch-mua-mail) (message-goto-to) (insert \"user@example.com\nDate: Fri, 29 Mar 1974 10:00:00 -0000\") (message-goto-subject) (insert \"Testing message sent via SMTP\") (message-goto-body) (insert \"This is a test that messages are sent via SMTP\") (message-send-and-exit)" >/dev/null 2>&1 wait ${smtp_dummy_pid} output=$(sed \ -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \ - -e s',^Date:.*,Date: XXX,' \ -e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message) test_expect_equal "$output" "From: Notmuch Test Suite To: user@example.com Subject: Testing message sent via SMTP +Date: Fri, 29 Mar 1974 10:00:00 -0000 User-Agent: Notmuch/XXX Emacs/XXX -Date: XXX Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii