source: trunk/source/tests/ansi-tests/open-stream-p.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.3 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jan 13 19:52:30 2004
4;;;; Contains: Tests of OPEN-STREAM-P
5
6(in-package :cl-test)
7
8(deftest open-stream-p.1
9  (loop for s in (list *debug-io* *error-output* *query-io*
10                       *standard-input* *standard-output*
11                       *trace-output* *terminal-io*)
12        for results = (multiple-value-list (open-stream-p s))
13        unless (and (eql (length results) 1)
14                    (car results))
15        collect s)
16  nil)
17
18(deftest open-stream-p.2
19  (with-open-file (s "open-stream-p.lsp" :direction :input)
20                  (notnot-mv (open-stream-p s)))
21  t)
22
23(deftest open-stream-p.3
24  (with-open-file (s "foo.txt" :direction :output
25                     :if-exists :supersede)
26                  (notnot-mv (open-stream-p s)))
27  t)
28
29(deftest open-stream-p.4
30  (let ((s (open "open-stream-p.lsp" :direction :input)))
31    (close s)
32    (open-stream-p s))
33  nil)
34
35(deftest open-stream-p.5
36  (let ((s (open "foo.txt" :direction :output
37                 :if-exists :supersede)))
38    (close s)
39    (open-stream-p s))
40  nil)
41
42;;; error tests
43
44(deftest open-stream-p.error.1
45  (signals-error (open-stream-p) program-error)
46  t)
47
48(deftest open-stream-p.error.2
49  (signals-error (open-stream-p *standard-input* nil) program-error)
50  t)
51
52(deftest open-stream-p.error.3
53  (check-type-error #'open-stream-p #'streamp)
54  nil)
Note: See TracBrowser for help on using the repository browser.