emacs-diffs
[Top][All Lists]
Advanced

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

master e3861aeb484: (test-replace-match-modification-hooks): Delete test


From: Stefan Monnier
Subject: master e3861aeb484: (test-replace-match-modification-hooks): Delete test
Date: Tue, 9 Apr 2024 11:01:40 -0400 (EDT)

branch: master
commit e3861aeb484c59c36b2448e17b54a37d779f6486
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (test-replace-match-modification-hooks): Delete test
    
    * test/src/search-tests.el (test-replace-match-modification-hooks):
    Delete, this is testing a functionality we can't really support.
---
 test/src/search-tests.el | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/test/src/search-tests.el b/test/src/search-tests.el
index bab503f36bf..87d2f5bfa05 100644
--- a/test/src/search-tests.el
+++ b/test/src/search-tests.el
@@ -21,23 +21,25 @@
 
 (require 'ert)
 
-(ert-deftest test-replace-match-modification-hooks ()
-  (let ((ov-set nil))
-    (with-temp-buffer
-      (insert "1 abc")
-      (setq ov-set (make-overlay 3 5))
-      (overlay-put
-       ov-set 'modification-hooks
-       (list (lambda (_o after &rest _args)
-              (when after
-                (let ((inhibit-modification-hooks t))
-                  (save-excursion
-                    (goto-char 2)
-                    (insert "234")))))))
-      (goto-char 3)
-      (if (search-forward "bc")
-         (replace-match "bcd"))
-      (should (= (point) 10)))))
+;; This test was bad: modification hooks should never modify
+;; the buffer text, because it causes problems in too many places.
+;;(ert-deftest test-replace-match-modification-hooks () ;bug#42424
+;;  (let ((ov-set nil))
+;;    (with-temp-buffer
+;;      (insert "1 abc")
+;;      (setq ov-set (make-overlay 3 5))
+;;      (overlay-put
+;;       ov-set 'modification-hooks
+;;       (list (lambda (_o after &rest _args)
+;;               (when after
+;;                 (let ((inhibit-modification-hooks t))
+;;                   (save-excursion
+;;                     (goto-char 2)
+;;                     (insert "234")))))))
+;;      (goto-char 3)
+;;      (if (search-forward "bc")
+;;          (replace-match "bcd"))
+;;      (should (= (point) 10)))))
 
 (ert-deftest search-test--replace-match-update-data ()
   (with-temp-buffer



reply via email to

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