two-way-stream-input-stream.lsp 859 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Thu Feb 12 04:22:50 2004
;;;; Contains: Tests of TWO-WAY-STREAM-INPUT-STREAM

(in-package :cl-test)

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

(deftest two-way-stream-input-stream.error.1
  (signals-error (two-way-stream-input-stream) program-error)
  t)

(deftest two-way-stream-input-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-two-way-stream is os)))
                   (two-way-stream-input-stream s nil))
                 program-error)
26
  t)