X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=test%2Femacs-attachment-warnings.el;h=8f4918ef60e114c3497f53709bbd85fed887a479;hp=a3067b1463070f3dfdefcd958659e1cb7c965749;hb=e663231681b129befadd9f66cb064c104149fb16;hpb=757ed001aad27d3c5ee8828174778b71013e4afd diff --git a/test/emacs-attachment-warnings.el b/test/emacs-attachment-warnings.el index a3067b14..8f4918ef 100644 --- a/test/emacs-attachment-warnings.el +++ b/test/emacs-attachment-warnings.el @@ -1,3 +1,4 @@ +(require 'cl-lib) (require 'notmuch-mua) (defun attachment-check-test (&optional fn) @@ -12,7 +13,8 @@ Return `t' if the message would be sent, otherwise `nil'" (condition-case nil ;; Force `y-or-n-p' to always return `nil', as if the user ;; pressed "n". - (letf (((symbol-function 'y-or-n-p) (lambda (&rest args) nil))) + (cl-letf (((symbol-function 'y-or-n-p) + (lambda (&rest args) nil))) (notmuch-mua-attachment-check) t) ('error nil)) @@ -65,16 +67,15 @@ Return `t' if the message would be sent, otherwise `nil'" (defun notmuch-test-attachment-warning-1 () (let (output expected) - (mapcar (lambda (test) - (let* ((expect (car test)) - (body (cdr test)) - (result (attachment-check-test body))) - (push expect expected) - (push (if (eq result expect) - result - ;; In the case of a failure, include the test - ;; details to make it simpler to debug. - (format "%S <-- %S" result body)) - output))) - attachment-check-tests) + (dolist (test attachment-check-tests) + (let* ((expect (car test)) + (body (cdr test)) + (result (attachment-check-test body))) + (push expect expected) + (push (if (eq result expect) + result + ;; In the case of a failure, include the test + ;; details to make it simpler to debug. + (format "%S <-- %S" result body)) + output))) (notmuch-test-expect-equal output expected)))