Commit 0ad733aa authored by pfdietz's avatar pfdietz
Browse files

More string input stream tests.

parent ffc95e60
......@@ -40,7 +40,7 @@
(values (read-line s)))
"bcd")
(deftest make-string-input-stream.6
(deftest make-string-input-stream.6
(let ((str1 (make-array 6 :element-type 'character
:initial-contents "abcdef"
:fill-pointer 4)))
......@@ -48,11 +48,46 @@
(values (read-line s) (read-char s nil :eof))))
"abcd" :eof)
(deftest make-string-input-stream.7
(let* ((str1 (make-array 6 :element-type 'character
:initial-contents "abcdef"))
(str2 (make-array 4 :element-type 'character
:displaced-to str1)))
(let ((s (make-string-input-stream str2)))
(values (read-line s) (read-char s nil :eof))))
"abcd" :eof)
(deftest make-string-input-stream.8
(let* ((str1 (make-array 6 :element-type 'character
:initial-contents "abcdef"))
(str2 (make-array 4 :element-type 'character
:displaced-to str1
:displaced-index-offset 1)))
(let ((s (make-string-input-stream str2)))
(values (read-line s) (read-char s nil :eof))))
"bcde" :eof)
(deftest make-string-input-stream.9
(let ((str1 (make-array 6 :element-type 'character
:initial-contents "abcdef"
:adjustable t)))
(let ((s (make-string-input-stream str1)))
(values (read-line s) (read-char s nil :eof))))
"abcdef" :eof)
(deftest make-string-input-stream.10
:notes (:allow-nil-arrays :nil-vectors-are-strings)
(let ((s (make-string-input-stream
(make-array 0 :element-type nil))))
(read-char s nil :eof))
:eof)
;;; Error tests
(deftest make-string-input-stream.error.1
(signals-error (make-string-input-stream) program-error)
t)
(deftest make-string-input-stream.error.2
(signals-error (make-string-input-stream "abc" 1 2 nil) program-error)
t)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment