aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2019-07-12 22:00:56 +0300
committerJuri Linkov2019-07-12 22:00:56 +0300
commit38e420af451c61dd0e77c7d73adf6fd1f6a021a9 (patch)
tree0058c2428c36e942ccb3d5241178f9147e716c8c
parent391e8e530a6a271810f96ee7aa2d544b8c01d597 (diff)
downloademacs-38e420af451c61dd0e77c7d73adf6fd1f6a021a9.tar.gz
emacs-38e420af451c61dd0e77c7d73adf6fd1f6a021a9.zip
* test/lisp/replace-tests.el (replace-tests-with-undo): Override
replace-highlight to emulate clobbering match-data (bug#36328).
-rw-r--r--test/lisp/replace-tests.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index ed948ad8554..c908d4e2a71 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -441,7 +441,7 @@ Return the last evalled form in BODY."
441 ;; If `replace-tests-bind-read-string' is non-nil, then 441 ;; If `replace-tests-bind-read-string' is non-nil, then
442 ;; bind `read-string' as well. 442 ;; bind `read-string' as well.
443 (cl-letf (((symbol-function 'read-event) 443 (cl-letf (((symbol-function 'read-event)
444 (lambda (&rest args) 444 (lambda (&rest _args)
445 (cl-incf ,count) 445 (cl-incf ,count)
446 (pcase ,count ; Build the clauses from CHAR-NUMS 446 (pcase ,count ; Build the clauses from CHAR-NUMS
447 ,@(append 447 ,@(append
@@ -456,8 +456,13 @@ Return the last evalled form in BODY."
456 `((_ ,def-chr)))))) 456 `((_ ,def-chr))))))
457 ((symbol-function 'read-string) 457 ((symbol-function 'read-string)
458 (if replace-tests-bind-read-string 458 (if replace-tests-bind-read-string
459 (lambda (&rest args) replace-tests-bind-read-string) 459 (lambda (&rest _args) replace-tests-bind-read-string)
460 (symbol-function 'read-string)))) 460 (symbol-function 'read-string)))
461 ;; Emulate replace-highlight clobbering match-data via
462 ;; isearch-lazy-highlight-new-loop and sit-for (bug#36328)
463 ((symbol-function 'replace-highlight)
464 (lambda (&rest _args)
465 (string-match "[A-Z ]" "ForestGreen"))))
461 (perform-replace ,from ,to t t nil)) 466 (perform-replace ,from ,to t t nil))
462 ,@body)))) 467 ,@body))))
463 468