org.el (org-options-keywords): Add "STYLE:"
[org-mode.git] / testing / lisp / test-ob-sh.el
blob88e1c92b536d9b1780d3f961da1cafda49164b81
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 (org-test-for-executable "sh")
13 (unless (featurep 'ob-sh)
14 (signal 'missing-test-dependency "Support for Sh code blocks"))
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:generic "echo 2" '())))
21 (should (string-match "^[\n\r][\t ]*[\n\r]"
22 (org-babel-expand-body:generic "\n\necho 2" '()))))
24 (ert-deftest test-ob-sh/dont-error-on-empty-results ()
25 "Was throwing an elisp error when shell blocks threw errors and
26 returned empty results."
27 (should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil))))
29 (ert-deftest test-ob-sh/session ()
30 "This also tests `org-babel-comint-with-output' in
31 ob-comint.el, which was not previously tested."
32 (let ((res (org-babel-execute:sh "echo 1; echo 2" '((:session . "yes")))))
33 (should res)
34 (should (listp res))))
36 (provide 'test-ob-sh)
38 ;;; test-ob-sh.el ends here