X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Frun-program.test.sh;h=beb6e42905259c455b7c41906704a74c0a105a44;hb=f2b65035e35f3f7ae5f645cea6338538235ca899;hp=50e12f31c182760c7c7773e5b3fd50f3ceb33279;hpb=b76e5fdf19ce4ab1c6983e6f4b301196484eecc2;p=sbcl.git diff --git a/tests/run-program.test.sh b/tests/run-program.test.sh index 50e12f3..beb6e42 100644 --- a/tests/run-program.test.sh +++ b/tests/run-program.test.sh @@ -82,6 +82,26 @@ ${SBCL:-sbcl} <<'EOF' :input i :output stream))))) (assert (= (length string) 6)) (assert (string= string "abcdef"))) + + ;;; Test the bookkeeping involved in decoding the child's output: + + ;; repeated short, properly-encoded reads exposed one bug. (But + ;; note: this test will be inconclusive if the child's stderr is + ;; fully buffered.) + (let ((str (with-output-to-string (s) + (run-program "/bin/sh" + '("-c" "(echo Foo; sleep 2s; echo Bar)>&2") + :output s :search t :error :output :wait t)))) + (assert (string= str (format nil "Foo~%Bar~%")))) + + ;; end of file in the middle of a UTF-8 character + (typep (nth-value 1 (ignore-errors + (let ((sb-impl::*default-external-format* :utf-8)) + (with-output-to-string (s) + (run-program "printf" '("\\316") + :output s :search t :wait t))))) + 'error) + ;; success convention for this Lisp program run as part of a larger script (sb-ext:quit :unix-status 52))) EOF