branch: externals/org
commit 5057f9e2dcda605d5d4822fb0e1f4469f5bf40b4
Author: Morgan Smith <[email protected]>
Commit: Ihor Radchenko <[email protected]>
test-org/move-subtree: Test that undo works as expected
* testing/lisp/test-org.el (test-org/move-subtree): Test that undo
works as expected.
---
testing/lisp/test-org.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 54ba2036bc..3887897f06 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -5887,12 +5887,14 @@ Text.
;;; Outline structure
(ert-deftest test-org/move-subtree ()
- "Test `org-metaup' and `org-metadown' on headings."
+ "Test `org-metaup' and `org-metadown' on headings.
+Also ensure undo works as expected."
(cl-flet*
((test-move-subtree (direction
initial-text
expected &optional selection)
(org-test-with-temp-text initial-text
+ (buffer-enable-undo)
(when selection
(set-mark (point))
(search-forward selection))
@@ -5906,6 +5908,11 @@ Text.
:type 'user-error)
(funcall func)
(should (equal expected
+ (buffer-string)))
+ (deactivate-mark)
+ (undo-boundary)
+ (undo)
+ (should (equal (string-replace "<point>" "" initial-text)
(buffer-string))))))))
(test-move-subtree 'down
"* H1<point>\n* H2\n"