source: trunk/source/tests/ansi-tests/terpri.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.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Jan 18 20:35:57 2004
4;;;; Contains: Tests of TERPRI
5
6(in-package :cl-test)
7
8(deftest terpri.1
9  (let (result)
10    (values
11     (with-output-to-string
12       (*standard-output*)
13       (write-char #\a)
14       (setq result (terpri)))
15     result))
16  #.(concatenate 'string "a" (string #\Newline))
17  nil)
18
19(deftest terpri.2
20  (let (result)
21    (values
22     (with-output-to-string
23       (s)
24       (write-char #\a s)
25       (setq result (terpri s)))
26     result))
27  #.(concatenate 'string "a" (string #\Newline))
28  nil)
29
30(deftest terpri.3
31  (with-output-to-string
32    (s)
33    (write-char #\x s)
34    (terpri s)
35    (terpri s)
36    (write-char #\y s))
37  #.(concatenate 'string "x" (string #\Newline) (string #\Newline) "y"))
38
39(deftest terpri.4
40  (with-output-to-string
41    (os)
42    (let ((*terminal-io* (make-two-way-stream *standard-input* os)))
43      (terpri t)
44      (finish-output t)))
45  #.(string #\Newline))
46
47(deftest terpri.5
48  (with-output-to-string
49    (*standard-output*)
50    (terpri nil))
51  #.(string #\Newline))
52
53;;; Error tests
54
55(deftest terpri.error.1
56  (signals-error
57   (with-output-to-string
58     (s)
59     (terpri s nil))
60   program-error)
61  t)
62
Note: See TracBrowser for help on using the repository browser.