File: pprint.lsp

package info (click to toggle)
cl-ansi-tests 20071218-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,000 kB
  • ctags: 22,025
  • sloc: lisp: 134,798; makefile: 144
file content (49 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sun Jul 25 11:42:48 2004
;;;; Contains: Tests of PPRINT

(in-package :cl-test)

(compile-and-load "printer-aux.lsp")

;;; This function is mostly tested elsewhere

(deftest pprint.1
  (random-pprint-test 1000)
  nil)

(deftest pprint.2
  (with-standard-io-syntax
   (with-output-to-string
     (os)
     (with-input-from-string
      (is "")
      (with-open-stream (*terminal-io* (make-two-way-stream is os))
			(pprint 2 t)))))
  "
2")

(deftest pprint.3
  (with-standard-io-syntax
   (with-output-to-string
     (*standard-output*)
     (pprint 3 nil)))
  "
3")

;;; Error tests

(deftest pprint.error.1
  (signals-error
   (with-output-to-string (*standard-output*) (pprint))
   program-error)
  t)

(deftest pprint.error.2
  (signals-error
   (with-output-to-string (s) (pprint nil s nil))
   program-error)
  t)