source: trunk/source/tests/ansi-tests/princ.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: 867 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Jul 25 11:40:37 2004
4;;;; Contains: Tests of PRINC
5
6(in-package :cl-test)
7
8(compile-and-load "printer-aux.lsp")
9
10;;; This function is mostly tested elsewhere
11
12(deftest princ.1
13  (random-princ-test 5)
14  nil)
15
16(deftest princ.2
17  (with-standard-io-syntax
18   (with-output-to-string
19     (os)
20     (with-input-from-string
21      (is "")
22      (with-open-stream (*terminal-io* (make-two-way-stream is os))
23                        (princ 2 t)))))
24  "2")
25
26(deftest princ.3
27  (with-standard-io-syntax
28   (with-output-to-string
29     (*standard-output*)
30     (princ 3 nil)))
31  "3")
32
33;;; Error tests
34
35(deftest princ.error.1
36  (signals-error
37   (with-output-to-string (*standard-output*) (princ))
38   program-error)
39  t)
40
41(deftest princ.error.2
42  (signals-error
43   (with-output-to-string (s) (princ nil s nil))
44   program-error)
45  t)
Note: See TracBrowser for help on using the repository browser.