0.7.9.34:
[sbcl.git] / tests / stream.impure.lisp
1 ;;;; tests related to Lisp streams
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;; 
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
13
14 (in-package :cl-user)
15
16 (load "assertoid.lisp")
17
18 ;;; type errors for inappropriate stream arguments, fixed in
19 ;;; sbcl-0.7.8.19
20 (locally
21     (declare (optimize (safety 3)))
22   (assert (raises-error? (make-two-way-stream (make-string-output-stream)
23                                               (make-string-output-stream))
24                          type-error))
25   (assert (raises-error? (make-two-way-stream (make-string-input-stream "foo")
26                                               (make-string-input-stream "bar"))
27                          type-error))
28   ;; the following two aren't actually guaranteed, because ANSI, as it
29   ;; happens, doesn't say "should signal an error" for
30   ;; MAKE-ECHO-STREAM. It's still good to have, but if future
31   ;; maintenance work causes this test to fail because of these
32   ;; MAKE-ECHO-STREAM clauses, consider simply removing these clauses
33   ;; from the test. -- CSR, 2002-10-06
34   (assert (raises-error? (make-echo-stream (make-string-output-stream)
35                                            (make-string-output-stream))
36                          type-error))
37   (assert (raises-error? (make-echo-stream (make-string-input-stream "foo")
38                                            (make-string-input-stream "bar"))
39                          type-error))
40   (assert (raises-error? (make-concatenated-stream
41                           (make-string-output-stream)
42                           (make-string-input-stream "foo"))
43                          type-error)))
44 \f
45 ;;; success
46 (quit :unix-status 104)