Manually revert to the Release 7.8.04 tag.
[org-mode.git] / testing / lisp / test-ob-sh.el
blob297c86e13deb52cbab9a41f642104025914630d1
1 ;;; test-ob-sh.el
3 ;; Copyright (c) 2010-2012 Eric Schulte
4 ;; Authors: Eric Schulte
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
9 ;; Template test file for Org-mode tests
11 ;;; Code:
12 (unless (featurep 'ob-sh)
13 (signal 'missing-test-dependency "Support for Sh code blocks"))
15 (ert-deftest test-ob-sh/dont-insert-spaces-on-expanded-bodies ()
16 "Expanded shell bodies should not start with a blank line
17 unless the body of the tangled block does."
18 (should-not (string-match "^[\n\r][\t ]*[\n\r]"
19 (org-babel-expand-body:generic "echo 2" '())))
20 (should (string-match "^[\n\r][\t ]*[\n\r]"
21 (org-babel-expand-body:generic "\n\necho 2" '()))))
23 (ert-deftest test-ob-sh/dont-error-on-empty-results ()
24 "Was throwing an elisp error when shell blocks threw errors and
25 returned empty results."
26 (should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil))))
28 (provide 'test-ob-sh)
30 ;;; test-ob-sh.el ends here