mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-25 14:01:07 -08:00
Improve PROCESS-ENVIRON tests
(ext:run-program "env" nil :environ '("foo=bar")) actually exits with non-zero
status because 1) PATH is not specified in the child process and even if it
were 2) the use of :ENVIRON prevents ECL from searching the PATH for child
programs.
Rewrite the tests to actually highlight the failure.
This commit is contained in:
parent
4e9fab94eb
commit
bad77f4915
1 changed files with 7 additions and 3 deletions
|
|
@ -176,9 +176,13 @@
|
|||
|
||||
#-windows
|
||||
(test process-environ
|
||||
(is (read-line (ext:run-program "env" nil) nil nil))
|
||||
(is (read-line (ext:run-program "env" nil :environ '("foo=bar")) nil nil))
|
||||
(is (read-line (ext:run-program "env" nil :environ :default) nil nil))
|
||||
(is-equal 0 (nth-value 1 (ext:run-program "env" nil)))
|
||||
(is-equal 0 (nth-value 1 (ext:run-program "env" nil :environ :default)))
|
||||
(is-equal "bar"
|
||||
(read-line (ext:run-program "printenv" '("foo")
|
||||
:environ (list "foo=bar"
|
||||
(format nil "PATH=~A" (ext:getenv "PATH"))))
|
||||
nil nil))
|
||||
(signals simple-error (ext:run-program "env" nil :environ :bam) nil nil)
|
||||
#-cygwin ;; Cygwin always injects `WINDIR=C:\\Windows' variable.
|
||||
(is (null (slurp (ext:run-program "/usr/bin/env" nil :environ nil)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue