diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index bec5e356c..82881aa28 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -2,7 +2,7 @@ ;;;; Jim Blandy --- May 1999 ;;;; ;;;; Copyright (C) 1999, 2001, 2004, 2006-2007, 2009-2015, 2017, 2019-2021, -;;;; 2024 Free Software Foundation, Inc. +;;;; 2024,2025 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -736,22 +736,23 @@ ;;;; Pipe (popen) ports. ;;; Run a command, and read its output. -(let* ((pipe (open-pipe "echo 'Howdy there, partner!'" "r")) - (in-string (read-all pipe))) - (close-pipe pipe) - (pass-if "pipe: read" - (equal? in-string "Howdy there, partner!\n"))) +(pass-if "pipe: read" + (let* ((pipe (open-pipe "echo 'Howdy there, partner!'" "r")) + (in-string (read-all pipe))) + (close-pipe pipe) + (equal? in-string "Howdy there, partner!\n"))) + ;;; Run a command, send some output to it, and see if it worked. -(let* ((filename (test-file)) - (pipe (open-pipe (string-append "grep Mommy > " filename) "w"))) - (display "Now Jimmy lives on a mushroom cloud\n" pipe) - (display "Mommy, why does everybody have a bomb?\n" pipe) - (close-pipe pipe) - (let ((in-string (read-file filename))) - (pass-if "pipe: write" - (equal? in-string "Mommy, why does everybody have a bomb?\n"))) - (delete-file filename)) +(pass-if "pipe: write" + (let* ((filename (test-file)) + (pipe (open-pipe (string-append "grep Mommy > " filename) "w"))) + (display "Now Jimmy lives on a mushroom cloud\n" pipe) + (display "Mommy, why does everybody have a bomb?\n" pipe) + (close-pipe pipe) + (let ((in-string (read-file filename))) + (delete-file filename) + (equal? in-string "Mommy, why does everybody have a bomb?\n")))) (pass-if-equal "pipe, fdopen, and line buffering" "foo\nbar\n"