mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-18 22:10:00 +00:00
test-ob-shell.el: Split test-ob-shell/dont-error-on-empty-results
* testing/lisp/test-ob-shell.el (test-ob-shell/dont-error-on-empty-results): Explicitly test handling of empty results. (test-ob-shell/dont-error-on-babel-error): Explicitly test handling of Babel errors. On pass, remove buffers created during test. Original test conflated empty results (a valid Babel return) and Babel errors.
This commit is contained in:
parent
dff9565c2c
commit
e204c3a6cc
|
@ -37,9 +37,13 @@ unless the body of the tangled block does."
|
||||||
(org-babel-expand-body:generic "\n\necho 2" '()))))
|
(org-babel-expand-body:generic "\n\necho 2" '()))))
|
||||||
|
|
||||||
(ert-deftest test-ob-shell/dont-error-on-empty-results ()
|
(ert-deftest test-ob-shell/dont-error-on-empty-results ()
|
||||||
"Was throwing an elisp error when shell blocks threw errors and
|
"Empty results should not cause a Lisp error."
|
||||||
returned empty results."
|
(should (null (org-babel-execute:sh "" nil))))
|
||||||
(should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil))))
|
|
||||||
|
(ert-deftest test-ob-shell/dont-error-on-babel-error ()
|
||||||
|
"Errors within Babel execution should not cause Lisp errors."
|
||||||
|
(if (should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil)))
|
||||||
|
(kill-buffer "*Org-Babel Error Output*")))
|
||||||
|
|
||||||
(ert-deftest test-ob-shell/session ()
|
(ert-deftest test-ob-shell/session ()
|
||||||
"This also tests `org-babel-comint-with-output' in
|
"This also tests `org-babel-comint-with-output' in
|
||||||
|
|
Loading…
Reference in a new issue