summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-18 15:32:19 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-18 15:32:23 +0200
commit3a1d713c19147a0eeb4829a8d3815e3292cbf1f3 (patch)
tree468eb39830808ba9d20883e4abc0739c2bdfe5a8
parentee812f2a987d295659c041c577aac8db93de819f (diff)
downloademacs-3a1d713c19147a0eeb4829a8d3815e3292cbf1f3.tar.gz
Add undo-in-region test case for bug#21523
-rw-r--r--test/lisp/simple-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 4b153d117f0..728911208eb 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -959,6 +959,17 @@ See Bug#21722."
(with-shell-command-dont-erase-buffer str output-buffer-is-current
(should (= (point) (alist-get shell-command-dont-erase-buffer expected-point)))))))
+(ert-deftest test-undo-region ()
+ (with-temp-buffer
+ (insert "This is a test\n")
+ (goto-char (point-min))
+ (setq buffer-undo-list nil)
+ (downcase-word 1)
+ (should (= (length (delq nil (undo-make-selective-list 1 9))) 2))
+ (should (= (length (delq nil (undo-make-selective-list 4 9))) 1))
+ ;; FIXME this is the off-by-one error case.
+ ;;(should (= (length (delq nil (undo-make-selective-list 5 9))) 0))
+ (should (= (length (delq nil (undo-make-selective-list 6 9))) 0)))
(provide 'simple-test)
;;; simple-test.el ends here