source: trunk/source/tests/ansi-tests/format-page.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.0 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Wed Jul 28 00:20:46 2004
4;;;; Contains: Tests of format with ~| directive
5
6(in-package :cl-test)
7(compile-and-load "printer-aux.lsp")
8
9(def-format-test format.page.1
10  "~0|" nil "")
11
12(deftest format.page.2
13  (let ((s (format nil "~|")))
14    (cond
15     ((string= s "") nil)
16     ((> (length s) 1) (values s :too-long))
17     (t
18      (let ((c (elt s 0)))
19        (loop for i from 2 to 100
20              for s = (format nil (format nil "~~~D|" i))
21              unless (and (= (length s) i)
22                          (every #'(lambda (c2) (char= c c2)) s))
23              collect i)))))
24  nil)
25
26(deftest format.page.3
27  (let ((s (format nil "~|")))
28    (cond
29     ((string= s "") nil)
30     ((> (length s) 1) (values s :too-long))
31     (t
32      (let ((c (elt s 0)))
33        (loop for i from 2 to 100
34              for s = (format nil "~v|" i)
35              unless (and (= (length s) i)
36                          (every #'(lambda (c2) (char= c c2)) s))
37              collect i)))))
38  nil)
39
40(def-format-test format.page.4
41  "~V|" (0) "")
42
43(def-format-test format.page.5
44  "~v|" (nil) #.(format nil "~|"))
Note: See TracBrowser for help on using the repository browser.