mirror of
https://github.com/janet-lang/janet
synced 2026-10-12 18:51:42 +00:00
Add test cases for missing programs with os/spawn and os/execute.
This commit is contained in:
@@ -641,4 +641,10 @@
|
||||
(string "'" x "'")))
|
||||
(assert (= 0 (os/shell (string/join [;run janet "-e" (shell-quote "(os/exit 0)")] " "))) "os/shell simple")
|
||||
|
||||
# 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")
|
||||
(assert (let [[ok _result] (protect (os/spawn [dne-path] :px))] (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")
|
||||
|
||||
(end-suite)
|
||||
|
||||
Reference in New Issue
Block a user