]> git.eshelyaron.com Git - emacs.git/commitdiff
Make sh-script-tests.el more robust
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 5 Apr 2024 17:43:56 +0000 (19:43 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 6 Apr 2024 06:44:25 +0000 (08:44 +0200)
* test/lisp/progmodes/sh-script-tests.el (test-sh-script-indentation)
(test-basic-sh-indentation, test-indent-after-continuation):
* test/lisp/progmodes/sh-script-resources/sh-indents.erts (Code):
Skip if `sh-indent-supported-here' is nil.  (Bug#70196)

(cherry picked from commit aa356d03aeb13942ae6688ce919e0aa9fb4f1689)

test/lisp/progmodes/sh-script-resources/sh-indents.erts
test/lisp/progmodes/sh-script-tests.el

index 36f4e4c22abdb24bca04632458a4ebf8a6c08131..5a72df0e7ef697591ad28d5d4f87d7864cee15df 100644 (file)
@@ -1,6 +1,10 @@
 Code:
   (lambda ()
     (shell-script-mode)
+    (unless sh-indent-supported-here
+      (ert-skip
+       '((skip-unless sh-indent-supported-here)
+        :form sh-indent-supported-here :value nil)))
     (indent-region (point-min) (point-max)))
 
 Name: sh-indents1
index e73d52399d3c34c44f363645d606264b52cc9c5f..45add34a111dc78c40e5fb10e569afd7d94d315d 100644 (file)
@@ -30,6 +30,7 @@
     (insert "relative-path/to/configure --prefix=$prefix\\
              --with-x")
     (shell-script-mode)
+    (skip-unless sh-indent-supported-here)
     (goto-char (point-min))
     (forward-line 1)
     (indent-for-tab-command)
@@ -42,6 +43,7 @@
   (with-temp-buffer
     (insert "myecho () {\necho foo\n}\n")
     (shell-script-mode)
+    (skip-unless sh-indent-supported-here)
     (indent-region (point-min) (point-max))
     (should (equal (buffer-string)
   "myecho () {
@@ -56,6 +58,7 @@
   (with-temp-buffer
     (insert "for f \\\nin a; do \\\ntoto; \\\ndone\n")
     (shell-script-mode)
+    (skip-unless sh-indent-supported-here)
     (let ((sh-indent-for-continuation '++))
       (let ((sh-indent-after-continuation t))
         (indent-region (point-min) (point-max))