source: trunk/source/tests/ansi-tests/write-char.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: 938 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Jan 18 20:50:31 2004
4;;;; Contains: Tests of WRITE-CHAR
5
6(in-package :cl-test)
7
8(deftest write-char.1
9  (loop for i from 0 to 255
10        for c = (code-char i)
11        when c
12        unless (string= (with-output-to-string
13                          (*standard-output*)
14                          (write-char c))
15                        (string c))
16        collect c)
17  nil)
18
19(deftest write-char.2
20  (with-input-from-string
21   (is "abcd")
22   (with-output-to-string
23     (os)
24     (let ((*terminal-io* (make-two-way-stream is os)))
25       (write-char #\$ t)
26       (close *terminal-io*))))
27  "$")
28
29(deftest write-char.3
30  (with-output-to-string
31    (*standard-output*)
32    (write-char #\: nil))
33  ":")
34
35;;; Error tests
36
37(deftest write-char.error.1
38  (signals-error (write-char) program-error)
39  t)
40
41(deftest write-char.error.2
42  (signals-error
43   (with-output-to-string
44     (s)
45     (write-char #\a s nil))
46   program-error)
47  t)
48
49;;; More tests in other files
50
51
Note: See TracBrowser for help on using the repository browser.