]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix Eshell tests on macOS
authorJim Porter <jporterbugs@gmail.com>
Fri, 30 Dec 2022 18:40:08 +0000 (10:40 -0800)
committerJim Porter <jporterbugs@gmail.com>
Fri, 30 Dec 2022 18:40:08 +0000 (10:40 -0800)
* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/if-statement-pipe)
(esh-cmd-test/if-else-statement-pipe):
* test/lisp/eshell/esh-io-tests.el (esh-io-test/pipeline/subcommands):
Allow trailing newlines in the output.

test/lisp/eshell/esh-cmd-tests.el
test/lisp/eshell/esh-io-tests.el

index cc40dde35520a600e0dcd02de2c179da233337a7..42d24967ff8c76fe945de579ca9af2888c86cc24 100644 (file)
@@ -274,24 +274,26 @@ This tests when `eshell-lisp-form-nil-is-failure' is nil."
 (ert-deftest esh-cmd-test/if-statement-pipe ()
   "Test invocation of an if statement piped to another command."
   (skip-unless (executable-find "rev"))
-  (let ((eshell-test-value t))
-    (eshell-command-result-equal "if $eshell-test-value {echo yes} | rev"
-                                 "sey"))
-  (let ((eshell-test-value nil))
-    (eshell-command-result-equal "if $eshell-test-value {echo yes} | rev"
-                                 nil)))
+  (with-temp-eshell
+   (let ((eshell-test-value t))
+     (eshell-match-command-output "if $eshell-test-value {echo yes} | rev"
+                                  "\\`sey\n?"))
+   (let ((eshell-test-value nil))
+     (eshell-match-command-output "if $eshell-test-value {echo yes} | rev"
+                                  "\\`\n?"))))
 
 (ert-deftest esh-cmd-test/if-else-statement-pipe ()
   "Test invocation of an if/else statement piped to another command."
   (skip-unless (executable-find "rev"))
-  (let ((eshell-test-value t))
-    (eshell-command-result-equal
-     "if $eshell-test-value {echo yes} {echo no} | rev"
-     "sey"))
-  (let ((eshell-test-value nil))
-    (eshell-command-result-equal
-     "if $eshell-test-value {echo yes} {echo no} | rev"
-     "on")))
+  (with-temp-eshell
+   (let ((eshell-test-value t))
+     (eshell-match-command-output
+      "if $eshell-test-value {echo yes} {echo no} | rev"
+      "\\`sey\n?"))
+   (let ((eshell-test-value nil))
+     (eshell-match-command-output
+      "if $eshell-test-value {echo yes} {echo no} | rev"
+      "\\`on\n?"))))
 
 (ert-deftest esh-cmd-test/unless-statement ()
   "Test invocation of an unless statement."
index 0f09afa19e4a7523c3850b06b68ebc225f5e0678..52501f5bb701b50a387a955e4711d573b69049ba 100644 (file)
@@ -320,8 +320,9 @@ stdout originally pointed (the terminal)."
 (ert-deftest esh-io-test/pipeline/subcommands ()
   "Chek that all commands in a subcommand are properly piped."
   (skip-unless (executable-find "rev"))
-  (eshell-command-result-equal "{echo foo; echo bar} | rev"
-                               "raboof"))
+  (with-temp-eshell
+   (eshell-match-command-output "{echo foo; echo bar} | rev"
+                                "\\`raboof\n?")))
 
 \f
 ;; Virtual targets