format-i.lsp 1.69 KB
Newer Older
pfdietz's avatar
pfdietz committed
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Aug 21 07:01:36 2004
;;;; Contains: Tests for the ~I format directive

(in-package :cl-test)

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

;;; pprint-indent.9
(def-pprint-test format.i.1
  (format nil "~<M~3:i~:@_M~:>" '(M M))
  "M
    M")

;;; See pprint-indent.10
(def-pprint-test format.i.2
  (format nil "~:<M~1:I~@:_M~:>" '(M M))
  "(M
   M)")

;;; See pprint-indent.11
(def-pprint-test format.i.3
  (format nil "~<(~;M~-1:i~:@_M~;)~:>" '(M M))
  "(M
 M)")

(def-pprint-test format.i.4
  (format nil "~:<M~-1:i~:@_M~:>" '(M M))
  "(M
 M)")

(def-pprint-test format.i.5
  (format nil "~<(~;M~:I~:@_M~;)~:>" '(M M))
  "(M
  M)")

(def-pprint-test format.i.6
  (format nil "~<(~;M~v:i~:@_M~;)~:>" '(nil))
  "(M
  M)")

(def-pprint-test format.i.7
  (format nil "~:<M~-2:i~:@_M~:>" '(M M))
  "(M
M)")

(def-pprint-test format.i.8
  (format nil "~<M~:i~:@_M~:>" '(M M))
  "M
 M")

;;; See pprint-indent.13
(def-pprint-test format.i.9
  (format nil "~<MMM~I~:@_MMMMM~:>" '(M M))
  "MMM
MMMMM")

(def-pprint-test format.i.10
  (format nil "~:<MMM~I~:@_MMMMM~:>" '(M M))
  "(MMM
 MMMMM)")

(def-pprint-test format.i.11
  (format nil "~<MMM~1I~:@_MMMMM~:>" '(M M))
  "MMM
 MMMMM")

(def-pprint-test format.i.12
  (format nil "XXX~<MMM~1I~:@_MMMMM~:>" '(M M))
  "XXXMMM
    MMMMM")

(def-pprint-test format.i.13
  (format nil "XXX~<MMM~I~:@_MMMMM~:>" '(M M))
  "XXXMMM
   MMMMM")

(def-pprint-test format.i.14
  (format nil "XXX~<MMM~-1I~:@_MMMMM~:>" '(M M))
  "XXXMMM
  MMMMM")

(def-pprint-test format.i.15
  (format nil "XXX~<MMM~vI~:@_MMMMM~:>" '(nil))
  "XXXMMM
   MMMMM")

(def-pprint-test format.i.16
  (format nil "XXX~<MMM~vI~:@_MMMMM~:>" '(2))
  "XXXMMM
     MMMMM")