emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 32b0f15 2/2: Add test for the fix in the parent com


From: Dmitry Gutov
Subject: [Emacs-diffs] master 32b0f15 2/2: Add test for the fix in the parent commit
Date: Fri, 16 Jun 2017 21:05:32 -0400 (EDT)

branch: master
commit 32b0f15365f0d33135866aa659c95372a775c6e3
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Add test for the fix in the parent commit
    
    * test/src/undo-tests.el (undo-test-skip-invalidated-markers):
    New test, for the fix in the parent commit.
---
 test/src/undo-tests.el | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index fbd3bf8..0cf7fc9 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -444,5 +444,27 @@ Demonstrates bug 16818."
       (ert-run-tests-interactively "^undo-")
     (ert-run-tests-batch "^undo-")))
 
+(ert-deftest undo-test-skip-invalidated-markers ()
+  "Test marker adjustment when the marker points nowhere.
+Demonstrates bug 25599."
+  (with-temp-buffer
+    (buffer-enable-undo)
+    (insert ";; aaaaaaaaa
+;; bbbbbbbb")
+    (let ((overlay-modified
+           (lambda (ov after-p _beg _end &optional length)
+             (unless after-p
+               (when (overlay-buffer ov)
+                 (delete-overlay ov))))))
+      (save-excursion
+        (goto-char (point-min))
+        (let ((ov (make-overlay (line-beginning-position 2)
+                                (line-end-position 2))))
+          (overlay-put ov 'insert-in-front-hooks
+                       (list overlay-modified)))))
+    (kill-region (point-min) (line-beginning-position 2))
+    (undo-boundary)
+    (undo)))
+
 (provide 'undo-tests)
 ;;; undo-tests.el ends here



reply via email to

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