aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorDmitry Gutov2017-06-17 03:54:06 +0300
committerDmitry Gutov2017-06-17 03:55:49 +0300
commit32b0f15365f0d33135866aa659c95372a775c6e3 (patch)
treed9cdd223d598aa6730013393a1999fb3f2a23f80 /test/src
parente17d6e2f6f0b7e33f16884bcb29b4d5f4433941b (diff)
downloademacs-32b0f15365f0d33135866aa659c95372a775c6e3.tar.gz
emacs-32b0f15365f0d33135866aa659c95372a775c6e3.zip
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.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/undo-tests.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index fbd3bf84a42..0cf7fc9f59c 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -444,5 +444,27 @@ Demonstrates bug 16818."
444 (ert-run-tests-interactively "^undo-") 444 (ert-run-tests-interactively "^undo-")
445 (ert-run-tests-batch "^undo-"))) 445 (ert-run-tests-batch "^undo-")))
446 446
447(ert-deftest undo-test-skip-invalidated-markers ()
448 "Test marker adjustment when the marker points nowhere.
449Demonstrates bug 25599."
450 (with-temp-buffer
451 (buffer-enable-undo)
452 (insert ";; aaaaaaaaa
453;; bbbbbbbb")
454 (let ((overlay-modified
455 (lambda (ov after-p _beg _end &optional length)
456 (unless after-p
457 (when (overlay-buffer ov)
458 (delete-overlay ov))))))
459 (save-excursion
460 (goto-char (point-min))
461 (let ((ov (make-overlay (line-beginning-position 2)
462 (line-end-position 2))))
463 (overlay-put ov 'insert-in-front-hooks
464 (list overlay-modified)))))
465 (kill-region (point-min) (line-beginning-position 2))
466 (undo-boundary)
467 (undo)))
468
447(provide 'undo-tests) 469(provide 'undo-tests)
448;;; undo-tests.el ends here 470;;; undo-tests.el ends here