(assert (= (read-byte in) i)))
(process-close process))))
-#+sb-thread
-(with-test (:name :run-program-cat-2)
+(with-test (:name :run-program-cat-2 :skipped-on '(not :sb-thread))
;; Tests that reading from a FIFO is interruptible.
(let* ((process (sb-ext:run-program "/bin/cat" '()
:wait nil
(process-close proc)
(assert (not stopped))))))
+
+;; Check that in when you do run-program with :wait t that causes
+;; encoding error, it does not affect the following run-program
+(with-test (:name (:run-program :clean-exit-after-encoding-error))
+ (let ((had-error-p nil))
+ (flet ((barf (&optional (format :default))
+ (with-output-to-string (stream)
+ (run-program "/usr/bin/perl"
+ '("-e" "print \"\\x20\\xfe\\xff\\x0a\"")
+ :output stream
+ :external-format format)))
+ (no-barf ()
+ (with-output-to-string (stream)
+ (run-program "/bin/echo"
+ '("This is a test")
+ :output stream))))
+ (handler-case
+ (barf :utf-8)
+ (error ()
+ (setq had-error-p t)))
+ (assert had-error-p)
+ ;; now run the harmless program
+ (setq had-error-p nil)
+ (handler-case
+ (no-barf)
+ (error ()
+ (setq had-error-p t)))
+ (assert (not had-error-p)))))
+