test-org: More tests for cut and paste subtree

This commit is contained in:
Marco Wahl 2018-10-04 23:49:00 +02:00
parent 2ada40b796
commit 0ae2e656d7
1 changed files with 31 additions and 0 deletions

View File

@ -7457,6 +7457,37 @@ Contents
(org-paste-subtree 3 "* Text")
(buffer-string)))))
(ert-deftest test-org/cut-and-paste-subtree ()
"Test `org-cut-subtree' and `org-paste-subtree'."
(should
(equal
"* Two
two
* One
"
(org-test-with-temp-text
"* One
<point>* Two
two
"
(call-interactively #'org-cut-subtree)
(goto-char (point-min))
(call-interactively #'org-paste-subtree)
(buffer-string))))
(should
(equal
"* One
* Two
"
(org-test-with-temp-text
"* One
<point>* Two
"
(call-interactively #'org-cut-subtree)
(backward-char)
(call-interactively #'org-paste-subtree)
(buffer-string)))))
(provide 'test-org)
;;; test-org.el ends here