>From 3f712ecc2302a16514d0ce4b2dbb98f0330bc8a2 Mon Sep 17 00:00:00 2001
From: Matt Trzcinski <matt@excalamus.com>
Date: Tue, 20 Dec 2022 13:53:44 -0500
Subject: [PATCH 02/20] test-ob-shell.el: Split cases into two tests

* testing/lisp/test-ob-shell.el
(test-ob-shell/dont-error-on-empty-results): Fix ambiguity in test
name, docstring, and function.  Explicitly test for empty results.
(test-ob-shell/dont-error-on-babel-error): Explicitly test for babel
error handling.  Previously tested implicitly.  On pass, remove
buffers created during test.

Two sources of errors exist: 1) empty results and 2) babel errors.
Original test checked both, despite its name specifing only the first
type.  Change splits original test into two according type of error.
---
 testing/lisp/test-ob-shell.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el
index 816e93ac5..625dc64b9 100644
--- a/testing/lisp/test-ob-shell.el
+++ b/testing/lisp/test-ob-shell.el
@@ -37,9 +37,11 @@ unless the body of the tangled block does."
                         (org-babel-expand-body:generic "\n\necho 2" '()))))
 
 (ert-deftest test-ob-shell/dont-error-on-empty-results ()
-  "Was throwing an elisp error when shell blocks threw errors and
-returned empty results."
-  (should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil))))
+  (should (null (org-babel-execute:sh nil nil))))
+
+(ert-deftest test-ob-shell/dont-error-on-babel-error ()
+  (if (should (null (org-babel-execute:sh "ls NoSuchFileOrDirectory.txt" nil)))
+      (kill-buffer "*Org-Babel Error Output*")))
 
 (ert-deftest test-ob-shell/session ()
   "This also tests `org-babel-comint-with-output' in
-- 
2.38.1

