Browse Source

test-org: More tests for cut and paste subtree

Marco Wahl 7 years ago
parent
commit
0ae2e656d7
1 changed files with 31 additions and 0 deletions
  1. 31 0
      testing/lisp/test-org.el

+ 31 - 0
testing/lisp/test-org.el

@@ -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