streamp.lsp 1.03 KB
Newer Older
1 2 3 4 5 6 7 8 9
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Jan 17 17:12:38 2004
;;;; Contains: Tests for STREAMP

(in-package :cl-test)

(deftest streamp.1
  (loop for s in (list *debug-io* *error-output* *query-io*
sds's avatar
sds committed
10 11 12 13 14
                       *standard-input* *standard-output*
                       *trace-output* *terminal-io*)
        unless (equal (multiple-value-list (notnot-mv (streamp s)))
                      '(t))
        collect s)
15 16 17
  nil)

(deftest streamp.2
18
  (check-type-predicate #'streamp 'stream)
19 20 21 22
  nil)

(deftest streamp.3
  (let ((s (open "foo.txt" :direction :output
sds's avatar
sds committed
23
                 :if-exists :supersede)))
24 25 26 27 28 29
    (close s)
    (notnot-mv (streamp s)))
  t)

(deftest streamp.4
  (let ((s (open "foo.txt" :direction :output
sds's avatar
sds committed
30
                 :if-exists :supersede)))
31
    (unwind-protect
sds's avatar
sds committed
32
        (notnot-mv (streamp s))
33 34 35 36 37 38 39 40 41 42 43 44
      (close s)))
  t)

;;; Error tests

(deftest streamp.error.1
  (signals-error (streamp) program-error)
  t)

(deftest streamp.error.2
  (signals-error (streamp *standard-input* nil) program-error)
  t)