test-org-inlinetask.el 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ;;; test-org-inlinetask.el --- Tests for org-inlinetask.el
  2. ;; Copyright (c) Marco Wahl
  3. ;; Authors: Marco Wahl
  4. ;; This program is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. ;;; Comments:
  15. ;; Tests for org-inlinetask.el.
  16. ;;; Code:
  17. (require 'org-inlinetask)
  18. ;;; Test movement
  19. (ert-deftest test-org-inlinetask/goto-end ()
  20. "Tests around org-inlinetask."
  21. ;; Goto end.
  22. (should
  23. (equal "** H\n***** I\n***** END<point>\nfoo"
  24. (let ((org-inlinetask-min-level 5)
  25. (org-adapt-indentation t))
  26. (org-test-with-temp-text
  27. "** H\n<point>***** I\n***** END\nfoo"
  28. (org-inlinetask-goto-end)
  29. (insert "<point>")
  30. (buffer-string)))))
  31. ;; Goto end. End is buffer end.
  32. (should
  33. (equal "** H\n***** I\n***** END<point>"
  34. (let ((org-inlinetask-min-level 5)
  35. (org-adapt-indentation t))
  36. (org-test-with-temp-text
  37. "** H\n<point>***** I\n***** END"
  38. (org-inlinetask-goto-end)
  39. (insert "<point>")
  40. (buffer-string)))))
  41. ;; Goto end. Starting somewhere.
  42. (should
  43. (equal "** H\n***** I\n***** END<point>\n***** I\n***** END"
  44. (let ((org-inlinetask-min-level 5)
  45. (org-adapt-indentation t))
  46. (org-test-with-temp-text
  47. "** H\n****<point>* I\n***** END\n***** I\n***** END"
  48. (org-inlinetask-goto-end)
  49. (insert "<point>")
  50. (buffer-string))))))
  51. (provide 'test-org-inlinetask)
  52. ;;; test-org-inlinetask.el ends here