echo-stream-output-stream.lsp 840 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Thu Feb 12 04:32:33 2004
;;;; Contains: Tests off ECHO-STREAM-OUTPUT-STREAM

(in-package :cl-test)

(deftest echo-stream-output-stream.1
  (let* ((is (make-string-input-stream "foo"))
sds's avatar
sds committed
10 11
         (os (make-string-output-stream))
         (s (make-echo-stream is os)))
12
    (equalt (multiple-value-list (echo-stream-output-stream s))
sds's avatar
sds committed
13
            (list os)))
14 15 16 17 18 19 20 21
  t)

(deftest echo-stream-output-stream.error.1
  (signals-error (echo-stream-output-stream) program-error)
  t)

(deftest echo-stream-output-stream.error.2
  (signals-error (let* ((is (make-string-input-stream "foo"))
sds's avatar
sds committed
22 23 24 25
                        (os (make-string-output-stream))
                        (s (make-echo-stream is os)))
                   (echo-stream-output-stream s nil))
                 program-error)
26
  t)