diff options
author | dickmao <none> | 2021-06-23 00:23:48 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-06-23 00:23:48 +0200 |
commit | 2540701f300144fba8a3871f1f0c046c0ff41c5a (patch) | |
tree | cccd95c8084136136d2546d4e73991c790bdacc9 /test/lisp/gnus | |
parent | 142962a8bd9e1e4e926183a9f68a426ada91cda0 (diff) | |
download | emacs-2540701f300144fba8a3871f1f0c046c0ff41c5a.tar.gz emacs-2540701f300144fba8a3871f1f0c046c0ff41c5a.tar.bz2 emacs-2540701f300144fba8a3871f1f0c046c0ff41c5a.zip |
Fix message-replace-header after recent change
* lisp/gnus/message.el (message-replace-header): Restore else
branch removed by mistake in 989de3b824 (bug#49179).
Diffstat (limited to 'test/lisp/gnus')
-rw-r--r-- | test/lisp/gnus/message-tests.el | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el index 36ec8c51d15..b4f2b7f675d 100644 --- a/test/lisp/gnus/message-tests.el +++ b/test/lisp/gnus/message-tests.el @@ -154,6 +154,35 @@ "\"larsi@gnus.org\" <larsi@gnus.org>") "larsi@gnus.org"))) +(ert-deftest message-replace-header () + (with-temp-buffer + (save-excursion + (insert "From: dang@gnus.org +To: user1, + user2 +Cc: user3, + user4 +--text follows this line-- +Hello. +")) + (save-excursion + (message-replace-header "From" "ding@gnus.org") + (should (cl-search "ding" (message-field-value "From")))) + (save-excursion + (message-replace-header "From" "dong@gnus.org" "To") + (should (cl-search "dong" (message-field-value "From"))) + (should (re-search-forward "From:")) + (should-error (re-search-forward "To:")) + (should (re-search-forward "Cc:"))) + (save-excursion + (message-replace-header "From" "dang@gnus.org" (split-string "To Cc")) + (should (cl-search "dang" (message-field-value "From"))) + (should (re-search-forward "From:")) + (should-error (re-search-forward "To:")) + ;; That this isn't so is probably a bug from 1997. + ;; (should-error (re-search-forward "Cc:")) + ))) + (provide 'message-mode-tests) ;;; message-mode-tests.el ends here |