Commit c8b2025d authored by pfdietz's avatar pfdietz
Browse files

Begin adding tests of make-string-output-stream

parent 0ad733aa
......@@ -49,3 +49,4 @@
(load "make-concatenated-stream.lsp")
(load "get-output-stream-string.lsp")
(load "make-string-input-stream.lsp")
(load "make-string-output-stream.lsp")
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat Feb 14 19:42:07 2004
;;;; Contains: Tests of MAKE-STRING-OUTPUT-STREAM
(in-package :cl-test)
(deftest make-string-output-stream.1
(let ((s (make-string-output-stream)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.2
(let ((s (make-string-output-stream :element-type 'character)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.3
(let ((s (make-string-output-stream :element-type 'base-char)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.4
:notes (:nil-vectors-are-strings)
(let ((s (make-string-output-stream :element-type nil)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.5
(let ((s (make-string-output-stream :allow-other-keys nil)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.6
(let ((s (make-string-output-stream :allow-other-keys t :foo 'bar)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.7
(let ((s (make-string-output-stream :foo 'bar :allow-other-keys t
:allow-other-keys nil
:foo2 'x)))
(values
(notnot (typep s 'stream))
(notnot (typep s 'string-stream))
(input-stream-p s)
(notnot (output-stream-p s))
(notnot (open-stream-p s))))
t t nil t t)
(deftest make-string-output-stream.8
(let ((s (make-string-output-stream)))
(write-string "abc" s)
(write-string "def" s)
(get-output-stream-string s))
"abcdef")
(deftest make-string-output-stream.9
(let ((s (make-string-output-stream :element-type 'character)))
(write-string "abc" s)
(write-string "def" s)
(get-output-stream-string s))
"abcdef")
(deftest make-string-output-stream.10
(let ((s (make-string-output-stream :element-type 'base-char)))
(write-string "abc" s)
(write-string "def" s)
(get-output-stream-string s))
"abcdef")
(deftest make-string-output-stream.11
:notes (:nil-vectors-are-strings)
(let ((s (make-string-output-stream :element-type nil)))
(get-output-stream-string s))
"")
(deftest make0string-output-stream.12
(let ((s (make-string-output-stream)))
(values
(close s)
(open-stream-p s)))
t nil)
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