Comment 5 for bug 791800

Revision history for this message
Matthias Benkard (mulk) wrote :

This should be a good test. I can't really think of any others (other than using different values for DIRECTORY).

(with-test (:name (:run-program :set-directory))
  (let* ((directory #-win32 "/"
                    #+win32 "c:\\")
         (pwd (sb-ext:run-program #-win32 "/bin/sh"
                                  #-win32 '("-c" "pwd")
                                  #+win32 "c:\\windows\\system32\\cmd.exe"
                                  #+win32 '("/c" "cd")
                                  :output :stream
                                  :directory directory)))
    (unwind-protect
         (assert (string= (read-line (sb-ext:process-output pwd)) directory))
      (sb-ext:process-close pwd))))

Again, I'm not sure about the Windows version.