From 09b75c3a54d45418bf154aae59dda897080ed903 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 28 Sep 2026 16:49:43 -0500 Subject: [PATCH] Avoid using monkey-patched assert for this failure case. --- test/suite-ev.janet | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/suite-ev.janet b/test/suite-ev.janet index a49f15e9..dd7de68a 100644 --- a/test/suite-ev.janet +++ b/test/suite-ev.janet @@ -644,8 +644,13 @@ # os/spawn and os/execute when program does not exist gives a normal error (def dne-path "this-long-binary-name-does-not-exist") (assert (nil? (os/stat dne-path :mode)) "binary path does not exist 1") -# On some systems, the intial process may launch but should immediately fail. Other systems will refuse to launch a process. -(assert (let [[ok _result] (protect (let [p (os/spawn [dne-path] :p)] (assert (zero? (:wait p)))))] (not ok)) +(assert (let [[ok _result] + (protect + (let [process (os/spawn [dne-path] :p)] + # if initial process launch works, it should at least fail with a non-zero exit code. + (if-not (= 0 (:wait process)) + (error "should error"))))] + (not ok)) "binary path does not exist 2 - os/spawn") (assert (let [[ok _result] (protect (os/execute [dne-path] :px))] (not ok)) "binary path does not exist 2 - os/execute")