From 825e85b393a3d78ba43176ecc5bc1a9595d0fbea Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 2 Oct 2020 18:38:02 +0200 Subject: Use `advice-flet' in place of `cl-letf' to avoid primitive redefinition * test/lisp/time-stamp-tests.el (with-time-stamp-system-name): Use `advice-flet' to advice primitive avoiding redefinition. * test/lisp/tempo-tests.el (tempo-p-element-test) (tempo-P-element-test, tempo-r-element-test) (tempo-s-element-test, tempo-r>-element-test): Likewise. * test/lisp/subr-tests.el (subr-tests-bug22027): Likewise. * test/lisp/shadowfile-tests.el (shadow-test00-clusters) (shadow-test01-sites, shadow-test06-literal-groups) (shadow-test07-regexp-groups): Likewise. * test/lisp/replace-tests.el (replace-tests-with-undo): Likewise. * test/lisp/play/dissociate-tests.el (dissociate-tests-dissociated-press): Likewise. * test/lisp/net/tramp-tests.el (tramp-test10-write-region) (tramp-test21-file-links): Likewise. * test/lisp/kmacro-tests.el (kmacro-tests-call-macro-hint-and-repeat) (kmacro-tests-repeat-on-last-key) (kmacro-tests-repeat-view-and-run) (kmacro-tests-bind-to-key-with-key-sequence-in-use): Likewise. * test/lisp/files-tests.el (files-tests-read-file-in-~): Likewise. * test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice): Likewise. * test/lisp/bookmark-tests.el (bookmark-test-bmenu-locate): Likewise. * test/lisp/abbrev-tests.el (inverse-add-abbrev-skips-trailing-nonword) (inverse-add-abbrev-skips-trailing-nonword/positive-arg) (inverse-add-abbrev-skips-trailing-nonword/negative-arg): Likewise. --- test/lisp/subr-tests.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/lisp/subr-tests.el') diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 035c064d75c..b131b509355 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -337,8 +337,8 @@ cf. Bug#25477." (ert-deftest subr-tests-bug22027 () "Test for https://debbugs.gnu.org/22027 ." (let ((default "foo") res) - (cl-letf (((symbol-function 'read-string) - (lambda (_prompt _init _hist def) def))) + (advice-flet ((read-string + (lambda (_prompt _init _hist def) def))) (setq res (read-passwd "pass: " 'confirm (mapconcat #'string default ""))) (should (string= default res))))) -- cgit v1.2.3