test-ob-sh.el 883 B

12345678910111213141516171819202122232425262728293031323334
  1. ;;; test-ob-sh.el
  2. ;; Copyright (c) 2010 Eric Schulte
  3. ;; Authors: Eric Schulte
  4. ;; Released under the GNU General Public License version 3
  5. ;; see: http://www.gnu.org/licenses/gpl-3.0.html
  6. ;;;; Comments:
  7. ;; Template test file for Org-mode tests
  8. ;;; Code:
  9. (let ((load-path (cons (expand-file-name
  10. ".." (file-name-directory
  11. (or load-file-name buffer-file-name)))
  12. load-path)))
  13. (require 'org-test)
  14. (require 'org-test-ob-consts))
  15. ;;; Tests
  16. (ert-deftest test-ob-sh/dont-insert-spaces-on-expanded-bodies ()
  17. "Expanded shell bodies should not start with a blank line
  18. unless the body of the tangled block does."
  19. (should-not (string-match "^[\n\r][\t ]*[\n\r]"
  20. (org-babel-expand-body:sh "echo 2" '())))
  21. (should (string-match "^[\n\r][\t ]*[\n\r]"
  22. (org-babel-expand-body:sh "\n\necho 2" '()))))
  23. (provide 'test-ob-sh)
  24. ;;; test-ob-sh.el ends here