]> git.eshelyaron.com Git - emacs.git/commitdiff
(test-replace-match-modification-hooks): Delete test
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 9 Apr 2024 15:01:36 +0000 (11:01 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 10 Apr 2024 20:30:27 +0000 (22:30 +0200)
* test/src/search-tests.el (test-replace-match-modification-hooks):
Delete, this is testing a functionality we can't really support.

(cherry picked from commit e3861aeb484c59c36b2448e17b54a37d779f6486)

test/src/search-tests.el

index bab503f36bfd2c1a2ee781ea927423ab745495a7..87d2f5bfa05b7226bce2640915b182bc42e7016b 100644 (file)
 
 (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