From: Stefan Monnier Date: Tue, 9 Apr 2024 15:01:36 +0000 (-0400) Subject: (test-replace-match-modification-hooks): Delete test X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d765d5b884b1b2ae8a72fa8ffd3adfedf789ff7c;p=emacs.git (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. (cherry picked from commit e3861aeb484c59c36b2448e17b54a37d779f6486) --- 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