source: trunk/source/tests/ansi-tests/concatenated-stream-streams.lsp @ 8991

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

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

File size: 1.6 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Feb 14 08:43:45 2004
4;;;; Contains: Tests of CONCATENATED-STREAM-STREAMS
5
6(in-package :cl-test)
7
8(deftest concatenated-stream-streams.1
9  (concatenated-stream-streams (make-concatenated-stream))
10  nil)
11
12(deftest concatenated-stream-streams.2
13  (equalt (list (list *standard-input*))
14          (multiple-value-list
15           (concatenated-stream-streams
16            (make-concatenated-stream *standard-input*))))
17  t)
18
19(deftest concatenated-stream-streams.3
20  (with-input-from-string
21   (s1 "abc")
22   (with-input-from-string
23    (s2 "def")
24    (let ((s (make-concatenated-stream s1 s2)))
25      (equalt (list (list s1 s2))
26              (multiple-value-list
27               (concatenated-stream-streams s))))))
28  t)
29
30(deftest concatenated-stream-streams.4
31  (with-input-from-string
32   (s1 "")
33   (with-input-from-string
34    (s2 "def")
35    (let ((s (make-concatenated-stream s1 s2)))
36      (equalt (list (list s1 s2))
37              (multiple-value-list
38               (concatenated-stream-streams s))))))
39  t)
40
41(deftest concatenated-stream-streams.5
42  (with-input-from-string
43   (s1 "")
44   (with-input-from-string
45    (s2 "def")
46    (let ((s (make-concatenated-stream s1 s2)))
47      (values
48       (read-char s)
49       (equalt (list (list s2))
50               (multiple-value-list
51                (concatenated-stream-streams s)))))))
52  #\d t)
53
54;;; Error cases
55
56(deftest concatenated-stream-streams.error.1
57  (signals-error (concatenated-stream-streams) program-error)
58  t)
59
60(deftest concatenated-stream-streams.error.2
61  (signals-error (concatenated-stream-streams
62                  (make-concatenated-stream)
63                  nil)
64                 program-error)
65  t)
66
67
Note: See TracBrowser for help on using the repository browser.