(defvar *scratch-file-stream*)
(dolist (scratch-file-length '(1 ; everyone's favorite corner case
200123)) ; hopefully much bigger than buffer
- (format t "/SCRATCH-FILE-LENGTH=~D~%" scratch-file-length)
+ (format t "/SCRATCH-FILE-LENGTH=~W~%" scratch-file-length)
(with-open-file (s *scratch-file-name* :direction :output)
(dotimes (i scratch-file-length)
(write-char #\x s)))
(expect #\z))
(expect nil))))) ; i.e. end of file
(delete-file *scratch-file-name*))
+
+(with-open-file (s *scratch-file-name* :direction :output)
+ (format s "1234~%"))
+(assert
+ (string=
+ (with-open-file (s *scratch-file-name* :direction :input)
+ (let* ((b (make-string 10)))
+ (peek-char nil s)
+ (read-sequence b s)
+ b))
+ (format nil "1234")
+ :end1 4))
+(delete-file *scratch-file-name*)