From 9f352bbbfc4b49d3acd690328a8e43ba134baa83 Mon Sep 17 00:00:00 2001
From: Matt Trzcinski <matt@excalamus.com>
Date: Sun, 25 Dec 2022 23:25:21 -0500
Subject: [PATCH 20/20] test-ob-shell.el: Organize tests

* testing/lisp/test-ob-shell.el:

  - Provide instructions for running tests
  - Require `org-test' explicitly
  - Group tests into sections
  - Insert `page-delimiter's between sections
---
 testing/lisp/test-ob-shell.el | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el
index e4a9849c6..08bf40553 100644
--- a/testing/lisp/test-ob-shell.el
+++ b/testing/lisp/test-ob-shell.el
@@ -18,17 +18,26 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+
 ;;; Comment:
 
+;; To run tests, load this file and then call (ert "test-ob-shell").
+;; See README for other ways to run tests.
+
+
 ;;; Requirements:
-(org-test-for-executable "sh")
 
+(require 'org-test (expand-file-name "../org-test.el"))
 (require 'ob-core)
 
 (unless (featurep 'ob-shell)
   (signal 'missing-test-dependency "Support for Shell code blocks"))
 
+(org-test-for-executable "sh")
+
+
 ;;; Code:
+
 (defun test-ob-shell-multiline-string (&rest strings)
   "Join STRINGS with newlines.
 
@@ -43,6 +52,9 @@ Each expression of STRINGS should evaluate to a string.
 \(fn STRINGS)"
   (string-join strings "\n"))
 
+
+;;; Results
+
 (ert-deftest test-ob-shell/dont-insert-spaces-on-expanded-bodies ()
   "Expanded shell bodies should not start with a blank line unless
 the strings of the tangled block does."
@@ -298,6 +310,7 @@ string. Bash cannot handle lists in associative arrays."
       "- 1\n- 2\n- 3\n"
       (buffer-substring-no-properties (point) (point-max))))))
 
+
 ;;; Standard output
 
 (ert-deftest test-ob-shell/standard-output-after-success ()
@@ -314,6 +327,7 @@ string. Bash cannot handle lists in associative arrays."
                   "echo 1; exit 2" nil)))
       (kill-buffer "*Org-Babel Error Output*")))
 
+
 ;;; Standard error
 
 (ert-deftest test-ob-shell/error-output-after-success ()
@@ -362,6 +376,7 @@ buffer, alongside multiple exit codes."
                          (buffer-string)))))
       (kill-buffer "*Org-Babel Error Output*")))
 
+
 ;;; Exit codes
 
 (ert-deftest test-ob-shell/exit-code ()
-- 
2.38.1

