aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/gnus
diff options
context:
space:
mode:
authorStefan Kangas2020-09-10 19:32:33 +0200
committerStefan Kangas2020-09-10 19:32:53 +0200
commitbe4c4a7389cf0a47bc2c3e2896d4d0e2f09daa16 (patch)
tree2ecd56ab675cc3333ef2e4f2d385819cd589d792 /test/lisp/gnus
parentba3e2b80c04440c6a258b647a583d0a0afeabf83 (diff)
downloademacs-be4c4a7389cf0a47bc2c3e2896d4d0e2f09daa16.tar.gz
emacs-be4c4a7389cf0a47bc2c3e2896d4d0e2f09daa16.zip
Use lexical-binding in mml-sec-tests.el
* test/lisp/gnus/mml-sec-tests.el: Use lexical-binding. (mml-secure-test-mail-fixture) (mml-secure-test-en-decrypt-with-passphrase): Fix warnings.
Diffstat (limited to 'test/lisp/gnus')
-rw-r--r--test/lisp/gnus/mml-sec-tests.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el
index 673fa6984a1..0911932665d 100644
--- a/test/lisp/gnus/mml-sec-tests.el
+++ b/test/lisp/gnus/mml-sec-tests.el
@@ -1,4 +1,4 @@
1;;; gnustest-mml-sec.el --- Tests mml-sec.el, see README-mml-secure.txt. 1;;; mml-sec-tests.el --- Tests mml-sec.el, see README-mml-secure.txt. -*- lexical-binding:t -*-
2;; Copyright (C) 2015 Free Software Foundation, Inc. 2;; Copyright (C) 2015 Free Software Foundation, Inc.
3 3
4;; Author: Jens Lechtenbörger <jens.lechtenboerger@fsfe.org> 4;; Author: Jens Lechtenbörger <jens.lechtenboerger@fsfe.org>
@@ -51,6 +51,8 @@ Mostly, the empty passphrase is used. However, the keys for
51 '(sign-pgp sign-pgp-mime sign-smime) 51 '(sign-pgp sign-pgp-mime sign-smime)
52 '(sign-pgp sign-pgp-mime))) 52 '(sign-pgp sign-pgp-mime)))
53 53
54(defvar mml-smime-use)
55
54(defun mml-secure-test-fixture (body &optional interactive) 56(defun mml-secure-test-fixture (body &optional interactive)
55 "Setup GnuPG home containing test keys and prepare environment for BODY. 57 "Setup GnuPG home containing test keys and prepare environment for BODY.
56If optional INTERACTIVE is non-nil, allow questions to the user in case of 58If optional INTERACTIVE is non-nil, allow questions to the user in case of
@@ -120,9 +122,9 @@ Subject: Test
120Pass optional INTERACTIVE to mml-secure-test-fixture." 122Pass optional INTERACTIVE to mml-secure-test-fixture."
121 (mml-secure-test-fixture 123 (mml-secure-test-fixture
122 (lambda () 124 (lambda ()
123 (let ((context (if (memq method '(enc-smime enc-sign-smime sign-smime)) 125 (let ((_context (if (memq method '(enc-smime enc-sign-smime sign-smime))
124 (epg-make-context 'CMS) 126 (epg-make-context 'CMS)
125 (epg-make-context 'OpenPGP))) 127 (epg-make-context 'OpenPGP)))
126 ;; Verify and decrypt by default. 128 ;; Verify and decrypt by default.
127 (mm-verify-option 'known) 129 (mm-verify-option 'known)
128 (mm-decrypt-option 'known) 130 (mm-decrypt-option 'known)
@@ -546,6 +548,10 @@ Pass optional INTERACTIVE to mml-secure-test-mail-fixture."
546 )))))) 548 ))))))
547 interactive)) 549 interactive))
548 550
551(defvar mml-smime-cache-passphrase)
552(defvar mml2015-cache-passphrase)
553(defvar mml1991-cache-passphrase)
554
549(defun mml-secure-test-en-decrypt-with-passphrase 555(defun mml-secure-test-en-decrypt-with-passphrase
550 (method to from checksig jl-passphrase do-cache 556 (method to from checksig jl-passphrase do-cache
551 &optional enc-keys expectfail) 557 &optional enc-keys expectfail)
@@ -562,7 +568,7 @@ If optional EXPECTFAIL is non-nil, a decryption failure is expected."
562 (mml-smime-cache-passphrase do-cache) 568 (mml-smime-cache-passphrase do-cache)
563 ) 569 )
564 (cl-letf (((symbol-function 'read-passwd) 570 (cl-letf (((symbol-function 'read-passwd)
565 (lambda (prompt &optional confirm default) jl-passphrase))) 571 (lambda (_prompt &optional _confirm _default) jl-passphrase)))
566 (mml-secure-test-en-decrypt method to from checksig t enc-keys expectfail) 572 (mml-secure-test-en-decrypt method to from checksig t enc-keys expectfail)
567 ))) 573 )))
568 574
@@ -897,4 +903,4 @@ So the second decryption fails."
897 (let ((with-smime nil)) 903 (let ((with-smime nil))
898 (ert-run-tests-batch))) 904 (ert-run-tests-batch)))
899 905
900;;; gnustest-mml-sec.el ends here 906;;; mml-sec-tests.el ends here