X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Frun-program.impure.lisp;h=8a4b3a3761304e488ba3bdedd228dd260856347a;hb=a51749228e41a0fd65024a0e15f38dba986a3ab7;hp=8eae0d03beef6d14a7dc697c05368aeba4ff9b7a;hpb=cf36165d87f08798b2fd94fb27d660ab0e9bd5dd;p=sbcl.git diff --git a/tests/run-program.impure.lisp b/tests/run-program.impure.lisp index 8eae0d0..8a4b3a3 100644 --- a/tests/run-program.impure.lisp +++ b/tests/run-program.impure.lisp @@ -293,3 +293,23 @@ (setq had-error-p t))) (assert (not had-error-p))))) +(with-test (:name (:run-program :no-such-thing)) + (assert (search "Couldn't execute" + (handler-case + (progn (run-program "no-such-program-we-hope" '()) nil) + (error (e) + (princ-to-string e)))))) + +(with-test (:name (:run-program :not-executable)) + (assert (search "Couldn't execute" + (handler-case + (progn (run-program "run-program.impure.lisp" '()) nil) + (error (e) + (princ-to-string e)))))) + +(with-test (:name (:run-program :if-input-does-not-exist)) + (let ((file (pathname (sb-posix:mktemp "rpXXXXXX")))) + (assert (null (sb-ext:run-program "/bin/cat" '() :input file))) + (assert (null (sb-ext:run-program "/bin/cat" '() :output #.(or *compile-file-truename* + *load-truename*) + :if-output-exists nil)))))