]> git.notmuchmail.org Git - notmuch/commitdiff
test: Use an explicit date in the message sent via (fake) SMTP
authorCarl Worth <cworth@cworth.org>
Thu, 28 Oct 2010 00:06:26 +0000 (17:06 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 28 Oct 2010 00:06:26 +0000 (17:06 -0700)
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

index 2db8542a571be8e7130b67c8974764f9eef120d2..6fab3003da54e673cf3bb18845e77d7ec9540e1f 100755 (executable)
@@ -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: <XXX>,' < sent_message)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 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: <XXX>
 MIME-Version: 1.0
 Content-Type: text/plain; charset=us-ascii