X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fstream.pure.lisp;h=4bf264c3b00d29d50445e02b7e8508f1bfacf81c;hb=1b650be8b800cf96e2c268ae317fb26d0bf36827;hp=016b31c413b413455db47e2e5ff9250eead741c4;hpb=d4e550ede8beccef4312e621a644b89f9d76f74d;p=sbcl.git diff --git a/tests/stream.pure.lisp b/tests/stream.pure.lisp index 016b31c..4bf264c 100644 --- a/tests/stream.pure.lisp +++ b/tests/stream.pure.lisp @@ -102,3 +102,23 @@ (assert (char= (read-char stream) #\a)) (assert (file-position stream :end)) (assert (eq (read-char stream nil 'foo) 'foo))) + +;;; MAKE-STRING-OUTPUT-STREAM and WITH-OUTPUT-TO-STRING take an +;;; :ELEMENT-TYPE keyword argument +(macrolet ((frob (element-type-form) + `(progn + (let ((s (with-output-to-string + (s nil ,@(when element-type-form + `(:element-type ,element-type-form)))))) + (assert (typep s '(simple-array ,(if element-type-form + (eval element-type-form) + 'character) + (0))))) + (get-output-stream-string + (make-string-output-stream + ,@(when element-type-form + `(:element-type ,element-type-form))))))) + (frob nil) + (frob 'character) + (frob 'base-char) + (frob 'nil))