[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 03f8442: Disable delay and ding in replace-tests

From: Mattias Engdegård
Subject: master 03f8442: Disable delay and ding in replace-tests
Date: Sat, 24 Jul 2021 14:47:47 -0400 (EDT)

branch: master
commit 03f844249cb15a8380d09041a537803c933a2769
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Disable delay and ding in replace-tests
    * test/lisp/replace-tests.el (replace-tests-with-undo):
    When testing the "U" (undo all changes) option, the code will delay
    and ding which is obnoxious in an automated test.
    Disabling that makes the test quiet and about 150 times faster.
 test/lisp/replace-tests.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index 6d004e6..417946c 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -465,7 +465,12 @@ Return the last evalled form in BODY."
                    ;; isearch-lazy-highlight-new-loop and sit-for (bug#36328)
                    ((symbol-function 'replace-highlight)
                     (lambda (&rest _args)
-                      (string-match "[A-Z ]" "ForestGreen"))))
+                      (string-match "[A-Z ]" "ForestGreen")))
+                   ;; Override `sit-for' and `ding' so that we don't have
+                   ;; to wait and listen to bells when running the test.
+                   ((symbol-function 'sit-for)
+                    (lambda (&rest _args) (redisplay)))
+                   ((symbol-function 'ding) 'ignore))
            (perform-replace ,from ,to t 
replace-tests-perform-replace-regexp-flag nil))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]