X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT310-emacs.sh;fp=test%2FT310-emacs.sh;h=5935819f4ba4404eb14802d921ff88c3cd2ea1db;hp=9bf68b480591ece6825991a47096642cbbffbb81;hb=c201ee2193f4868fca082d3fe094a8ad04ad58cc;hpb=0ff3786ac03684245488f09d59be98325877656b diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index 9bf68b48..5935819f 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -1106,4 +1106,29 @@ output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list \"\\x201cxyz\\x201d\"))") test_expect_equal "$output" '("\"\"" "abc`~!@#$%^&*-=_+123" "\"(abc\"" "\")abc\"" "\"\"\"abc\"" "\"'$'\x01''xyz\"" "\"“xyz”\"")' +test_begin_subtest "Sending a message calls the send message hooks" +emacs_deliver_message \ + 'Testing message sending hooks' \ + 'This is a test of the message sending hooks.' \ + "(message-goto-to) + (kill-whole-line) + (insert \"To: user@example.com\n\") + (add-hook 'notmuch-mua-send-hook (lambda () (goto-char (point-max)) (insert \"\nThis text added by the hook.\")))" +sed \ + -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 +Subject: Testing message sending hooks +Date: 01 Jan 2000 12:00:00 -0000 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain + +This is a test of the message sending hooks. +This text added by the hook. +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done