]> git.notmuchmail.org Git - notmuch/commitdiff
test: extend test of attachment warnings
authorÖrjan Ekeberg <ekeberg@kth.se>
Thu, 12 Dec 2019 23:35:36 +0000 (00:35 +0100)
committerDavid Bremner <david@tethera.net>
Sat, 14 Dec 2019 11:29:00 +0000 (07:29 -0400)
Check that attachment warnings are not raised when the word
"attach" only occurs in a forwarded message.

test/emacs-attachment-warnings.el

index 200ca7babd47eb767bc6ae3f6474c64fb389e516..a3067b1463070f3dfdefcd958659e1cb7c965749 100644 (file)
@@ -36,6 +36,12 @@ Return `t' if the message would be sent, otherwise `nil'"
           ;; fontification properties. For fontification to happen we need to
           ;; allow some time for redisplay.
           (sit-for 0.01)))
           ;; fontification properties. For fontification to happen we need to
           ;; allow some time for redisplay.
           (sit-for 0.01)))
+    (t . (lambda ()
+          ;; "attach" is only mentioned in a forwarded message.
+          (insert "Hello\n")
+          (insert "<#mml type=message/rfc822 disposition=inline>\n")
+          (insert "X-Has-Attach:\n")
+          (insert "<#/mml>\n")))
 
     ;; These should not be okay:
     (nil . (lambda () (insert "Here is an attachment:\n")))
 
     ;; These should not be okay:
     (nil . (lambda () (insert "Here is an attachment:\n")))
@@ -49,6 +55,12 @@ Return `t' if the message would be sent, otherwise `nil'"
             ;; looking at fontification properties. For fontification
             ;; to happen we need to allow some time for redisplay.
             (sit-for 0.01)))
             ;; looking at fontification properties. For fontification
             ;; to happen we need to allow some time for redisplay.
             (sit-for 0.01)))
+    (nil . (lambda ()
+          ;; "attachment" is mentioned before a forwarded message.
+          (insert "I also attach something.\n")
+          (insert "<#mml type=message/rfc822 disposition=inline>\n")
+          (insert "X-Has-Attach:\n")
+          (insert "<#/mml>\n")))
     ))
 
 (defun notmuch-test-attachment-warning-1 ()
     ))
 
 (defun notmuch-test-attachment-warning-1 ()