X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Fsimple-stream-tests.lisp;h=1a3199292a8f60e4d893e434102baf8ae91f9a2b;hb=c553e4be6da2d18f0827f190589c88e837b8b8a6;hp=182b752d45abc3ecf5d6dff20225e5c104a1766b;hpb=77d1a39f28fe8d240cf441a9a54a80d4bc98ea52;p=sbcl.git diff --git a/contrib/sb-simple-streams/simple-stream-tests.lisp b/contrib/sb-simple-streams/simple-stream-tests.lisp index 182b752..1a31992 100644 --- a/contrib/sb-simple-streams/simple-stream-tests.lisp +++ b/contrib/sb-simple-streams/simple-stream-tests.lisp @@ -118,13 +118,16 @@ (deftest write-read-inet (handler-case (with-open-stream (s (make-instance 'socket-simple-stream - :remote-host #(127 0 0 1) - :remote-port 7 + :remote-host #(127 0 0 1) + :remote-port 7 :direction :io)) - (string= (prog1 (write-line "Got it!" s) (finish-output s)) - (read-line s))) + (string= (prog1 (write-line "Got it!" s) (finish-output s)) + (read-line s))) ;; Fail gracefully if echo isn't activated on the system - (sb-bsd-sockets::connection-refused-error () t)) + (sb-bsd-sockets::connection-refused-error () t) + ;; Timeout may occur on the restricted systems (e.g. FreeBSD + ;; with jail(8) or blackhole(4) is used). + (sb-bsd-sockets::operation-timeout-error () t)) t) (deftest write-read-large-sc-1 @@ -197,7 +200,10 @@ (string= (prog1 (write-line content s) (finish-output s)) (read-line s)))) ;; Fail gracefully if echo isn't activated on the system - (sb-bsd-sockets::connection-refused-error () t)) + (sb-bsd-sockets::connection-refused-error () t) + ;; Timeout may occur on the restricted systems (e.g. FreeBSD + ;; with jail(8) or blackhole(4) is used). + (sb-bsd-sockets::operation-timeout-error () t)) t) @@ -373,8 +379,6 @@ Nothing to see here, move along.") :initial-content ,(or initial-content '*multi-line-string*)) ,@body)) -;;; 0.8.3.93 tried to fix LISTEN on dual channel streams, but failed to do so: - (deftest listen-dc-1 ;; LISTEN with filled buffer (with-dc-test-stream (s) (read-char s) (listen s)) @@ -430,7 +434,7 @@ Nothing to see here, move along.") T) (deftest line-length-dc-1 - ;; does LINE-LENGTH support simple streams? + ;; does LINE-LENGTH support simple streams? (with-dc-test-stream (s) (eql (sb-simple-streams:line-length s) (sb-kernel:line-length s))) @@ -502,8 +506,7 @@ Nothing to see here, move along.") ;; CLEAR-INPUT (via STREAM-MISC-DISPATCH) (with-sc-test-stream (*synonym*) (let ((s (make-synonym-stream '*synonym*))) - (clear-input s) - (listen s))) + (clear-input s))) NIL) (deftest synonym-stream-9 @@ -708,8 +711,7 @@ Nothing to see here, move along.") ;; CLEAR-INPUT (via STREAM-MISC-DISPATCH) (with-sc-test-stream (synonym) (let ((s (make-two-way-stream synonym synonym))) - (clear-input s) - (listen s))) + (clear-input s))) NIL) (deftest two-way-stream-9 @@ -794,8 +796,7 @@ Nothing to see here, move along.") ;; CLEAR-INPUT (via STREAM-MISC-DISPATCH) (with-sc-test-stream (*synonym*) (let ((s (make-echo-stream *synonym* *synonym*))) - (clear-input s) - (listen s))) + (clear-input s))) NIL) (deftest echo-stream-11 @@ -866,8 +867,7 @@ Nothing to see here, move along.") ;; CLEAR-INPUT (via STREAM-MISC-DISPATCH) (with-sc-test-stream (*synonym*) (let ((s (make-concatenated-stream *synonym*))) - (clear-input s) - (listen s))) + (clear-input s))) NIL) (deftest concatenated-stream-11 @@ -914,3 +914,19 @@ Nothing to see here, move along.") (deftest string-simple-stream-1 (values (subtypep 'string-simple-stream 'string-stream)) T) + +;; don't break fd-stream external-format support: + +(deftest external-format-1 + (progn + (with-open-file (s *test-file* + :direction :output + :if-exists :supersede + :element-type '(unsigned-byte 8)) + (write-byte 195 s) + (write-byte 132 s)) + (with-open-file (s *test-file* + :direction :input + :external-format :utf-8) + (char-code (read-char s)))) + 196)