X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Frun-program.impure.lisp;h=46238b9c5ceae0ff642589be8acbb037b2a3ca14;hb=83659744f9caa97aa83eb562d872b1c0127403c0;hp=a1efdf0b29b4515075be3f3fa3cde28eb284097c;hpb=c589b9363d23ec9133e5396adaf4240cb0a8bd18;p=sbcl.git diff --git a/tests/run-program.impure.lisp b/tests/run-program.impure.lisp index a1efdf0..46238b9 100644 --- a/tests/run-program.impure.lisp +++ b/tests/run-program.impure.lisp @@ -84,24 +84,27 @@ (defun read-linish (stream) (with-output-to-string (s) (loop for c = (read-char stream) - while (and c (not (eq #\newline c)) (not (eq #\return c))) - do (write-char c s)))) + while (and c (not (eq #\newline c))) + ;; Some eds like to send \r\n + do (unless (eq #\return c) + (write-char c s))))) (defun assert-ed (command response) (when command (write-line command *ed-in*) (force-output *ed-in*)) - (let ((got (read-linish *ed-out*))) - (unless (equal response got) - (error "wanted ~S from ed, got ~S" response got))) + (when response + (let ((got (read-linish *ed-out*))) + (unless (equal response got) + (error "wanted '~A' from ed, got '~A'" response got)))) *ed*) (unwind-protect (with-test (:name :run-program-ed) (assert-ed nil "4") - (assert-ed ".s/bar/baz/g" "") + (assert-ed ".s/bar/baz/g" nil) (assert-ed "w" "4") - (assert-ed "q" "") + (assert-ed "q" nil) (process-wait *ed*) (with-open-file (f *tmpfile*) (assert (equal "baz" (read-line f))))) @@ -156,7 +159,7 @@ (with-test (:name (:run-program :inherit-stdin)) (let (stopped) (flet ((status-hook (proc) - (ecase (sb-ext:process-status proc) + (case (sb-ext:process-status proc) (:stopped (setf stopped t))))) (let ((proc (sb-ext:run-program "/bin/ed" nil :search nil :wait nil :input t :output t