source: trunk/source/tests/ansi-tests/clear-input.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.4 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Wed Jan 28 06:12:39 2004
4;;;; Contains: Tests of CLEAR-INPUT
5
6(in-package :cl-test)
7
8;;; These tests are limited, since whether an input stream can be
9;;; cleared is not well specified.
10
11(deftest clear-input.1
12  (loop for s in (list *debug-io* *query-io*
13                       *standard-input* *terminal-io*)
14        always (eq (clear-input s) nil))
15  t)
16
17(deftest clear-input.2
18  (clear-input)
19  nil)
20
21(deftest clear-input.3
22  (clear-input nil)
23  nil)
24
25(deftest clear-input.4
26  (clear-input t)
27  nil)
28
29(deftest clear-input.5
30  (with-input-from-string
31   (is "!?*")
32   (let ((*terminal-io* (make-two-way-stream is (make-broadcast-stream))))
33     (clear-input t)))
34  nil)
35
36(deftest clear-input.6
37  (with-input-from-string
38   (*standard-input* "345")
39   (clear-input nil))
40  nil)
41
42;;; Error cases
43
44(deftest clear-input.error.1
45  :notes (:assume-no-simple-streams)
46  (signals-error (clear-input t nil) program-error)
47  t)
48
49(deftest clear-input.error.2
50  :notes (:assume-no-simple-streams)
51  (signals-error (clear-input nil nil) program-error)
52  t)
53
54(deftest clear-input.error.3
55  (signals-error (clear-input t nil nil) program-error)
56  t)
57
58(deftest clear-input.error.4
59  (signals-error (clear-input nil nil nil) program-error)
60  t)
61
62(deftest clear-input.error.5
63  (check-type-error #'clear-input #'(lambda (x) (typep x '(or stream (member nil t)))))
64  nil)
Note: See TracBrowser for help on using the repository browser.