Better handling of ill-formed lists
[org-mode/org-tableheadings.git] / testing / lisp / test-ob-sh.el
blob8ff7081be906d7cee213e4018e4697be431dcc63
1 ;;; test-ob-sh.el
3 ;; Copyright (c) 2010 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
12 ;;; Code:
13 (let ((load-path (cons (expand-file-name
14 ".." (file-name-directory
15 (or load-file-name buffer-file-name)))
16 load-path)))
17 (require 'org-test)
18 (require 'org-test-ob-consts))
21 ;;; Tests
22 (ert-deftest test-ob-sh/dont-insert-spaces-on-expanded-bodies ()
23 "Expanded shell bodies should not start with a blank line
24 unless the body of the tangled block does."
25 (should-not (string-match "^[\n\r][\t ]*[\n\r]"
26 (org-babel-expand-body:generic "echo 2" '())))
27 (should (string-match "^[\n\r][\t ]*[\n\r]"
28 (org-babel-expand-body:generic "\n\necho 2" '()))))
30 (ert-deftest test-ob-sh/dont-error-on-empty-results ()
31 "Was throwing an elisp error when shell blocks threw errors and
32 returned empty results."
33 (should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil))))
35 (provide 'test-ob-sh)
37 ;;; test-ob-sh.el ends here