Преглед на файлове

test-org: More tests for cut and paste subtree

Marco Wahl преди 7 години
родител
ревизия
0ae2e656d7
променени са 1 файла, в които са добавени 31 реда и са изтрити 0 реда
  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