source: trunk/source/tests/ansi-tests/format-circumflex.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: 20.9 KB
RevLine 
[8991]1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Nov 11 20:17:51 2004
4;;;; Contains: Tests of the ~^ format directive (inside other format constructs)
5
6(in-package :cl-test)
7(compile-and-load "printer-aux.lsp")
8
9;;; Tests of ~^ inside ~{ ... ~}
10
11(def-format-test format.^.{.1
12  "~{X ~A~^ Y ~A~^ ~}" ('(1 2 3 4 5)) "X 1 Y 2 X 3 Y 4 X 5")
13
14(def-format-test format.^.{.2
15  "~{X ~A~^ Y ~A~^ ~}" ('(1 2 3 4)) "X 1 Y 2 X 3 Y 4")
16
17(def-format-test format.^.{.3
18  "~1{~A~^~A~}" ('(1)) "1")
19
20(def-format-test format.^.{.4
21  "~0{~A~^~A~}" ('(1)) "")
22
23(def-format-test format.^.{.5
24  "~1{~A~^~A~}" ('(1 2 3)) "12")
25
26(def-format-test format.^.{.6
27  "~{~A~A~0^~A~}" ('(1 2 3 4 5 6)) "12")
28
29(def-format-test format.^.{.7
30  "~{~A~A~v^~A~}" ('(1 2 3 4 5 6 0 7 8 9 10 11 12)) "12456")
31
32(def-format-test format.^.{.8
33  "~{~#,3^~A~}" ('(1 2 3 4 5 6 7 8 9 10)) "1234567")
34
35(def-format-test format.^.{.9
36  "~{~2,#^~A~}~A" ('(1 2 3 4 5 6 7 8 9 10) 0) "123456780")
37
38(def-format-test format.^.{.10
39  "~{~#,#^~A~}" ('(1 2 3 4 5 6 7 8 9 10)) "")
40
41(def-format-test format.^.{.11
42  "~{~#,#,#^~A~}" ('(1 2 3 4 5 6 7 8 9 10)) "")
43
44(def-format-test format.^.{.12
45  "~{~#,1,2^~A~}" ('(1 2 3 4 5 6 7 8 9 10)) "123456789")
46
47(def-format-test format.^.{.13
48  "~{~#,#,v^~A~}" ('(1 2 3 4 5 6 7 8 9 10)) "246")
49
50(def-format-test format.^.{.14
51  "~{~#,#,v^~A~}" ('(1 2 3 4 5 6 7 8 9 10 11)) "246")
52
53(def-format-test format.^.{.15
54  "~{~#,#,v^~A~}" ('(1 2 3 4 5 6 7 8 9 10 11 12)) "246")
55
56(def-format-test format.^.{.16
57  "~{~#,#,v^~A~}" ('(1 2 3 4 5 6 7 8 9 10 11 12 13)) "246")
58
59(def-format-test format.^.{.17
60  "~{~#,#,v^~A~}" ('(1 2 3 4 5 6 7 8 9 10 11 12 13 14)) "2468")
61
62(def-format-test format.^.{.18
63  "~{~v,v^~A~}" ((list (1+ most-positive-fixnum)
64                       (1+ most-positive-fixnum)
65                       1))
66  "")
67
68(def-format-test format.^.{.19
69  "~{~0,v,v^~A~}" ((list (1+ most-positive-fixnum)
70                         (1+ most-positive-fixnum)
71                         1))
72  "")
73
74(def-format-test format.^.{.20
75  "~{~0,v,v^~A~}" ((list (1+ most-positive-fixnum)
76                         most-positive-fixnum
77                         1))
78  "1")
79
80(def-format-test format.^.{.21
81  "~{~1,v^~A~}" ('(nil 8 nil 7 0 6 1 5)) "876")
82
83(def-format-test format.^.{.22
84  "~{~0,v^~A~}" ('(3 8 1 7 3 6 nil 5)) "876")
85
86(def-format-test format.^.{.23
87  "~{~1,2,v^~A~}" ('(0 1 0 2 0 3 3 4)) "123")
88
89(def-format-test format.^.{.24
90  "~{~1,2,v^~A~}" ('(0 1 0 2 0 3 nil 4)) "1234")
91
92(def-format-test format.^.{.25
93  "~{~1,1,v^~A~}" ('(0 1 0 2 0 3 nil 4)) "123")
94
95(def-format-test format.^.{.26
96  "~{~'X^~A~}" ('(1 2 3)) "123")
97
98(def-format-test format.^.{.27
99  "~{~v,'X^~A~}" ('(0 1 #\x 2 nil 3 #\X 4 0 5)) "123")
100
101(def-format-test format.^.{.28
102  "~{~'X,v^~A~}" ('(0 1 #\x 2 nil 3 #\X 4 0 5)) "123")
103
104(def-format-test format.^.{.29
105  "~{~v,v^~A~}" ('(0 2 1 #\x #\X 2 5 #\X 3 #\y #\y 4 1 2 5)) "123")
106
107(def-format-test format.^.{.30
108  "~{~',,',^~A~}" ('(1 2 3)) "")
109
110(def-format-test format.^.{.31
111  "~{~1,v,v^~A~}" ('(#\a nil 0)) "0")
112
113(def-format-test format.^.{.32
114  "~{~v,1,v^~A~}" ('(#\a nil 0)) "0")
115
116(def-format-test format.^.{.33
117  "~{~v,v,v^~A~}" ('(#\a #\a nil 0)) "")
118
119;;; ~^ with ~:{
120
121(def-format-test format.^.\:{.1
122  "~:{~A~^~A~A~}" ('((1)(2 3 4)(5 6 7 8))) "1234567")
123
124(def-format-test format.^.\:{.2
125  "~:{~A~0^~A~A~}" ('((1)(2 3 4)(5 6 7 8))) "125")
126
127(def-format-test format.^.\:{.3
128  "~:{~#^~A~}" ('((1)(2 3 4)()(5 6 7 8))()) "125" 1)
129
130(def-format-test format.^.\:{.4
131  "~:{~#^~A~#^~A~#^~A~#^~A~}" ('((1)(2 3 4)()(5 6 7 8))()) "12345678" 1)
132
133(def-format-test format.^.\:{.5
134  "~:{~v^~A~}" ('((1 2 3)(0)(2 4)(0 5)(1 6 7 8))) "246")
135
136(def-format-test format.^.\:{.6
137  "~:{~v^~A~}" ('((nil)(nil 1)(1 2))) "12")
138
139(def-format-test format.^.\:{.7
140  "~:{~v^~A~}" ('((#\x 1)(#\y 2)(0 3)(1 4))) "124")
141
142(def-format-test format.^.\:{.8
143  "~:{~v,3^~A~}" ('((1 1)(2 0)(3 4)(5 6))) "106")
144
145(def-format-test format.^.\:{.9
146  "~:{~3,v^~A~}" ('((1 1)(2 0)(3 4)(5 6))) "106")
147
148(def-format-test format.^.\:{.10
149  "~:{~v,3^~A~}" ('((#\x 1))) "1")
150
151(def-format-test format.^.\:{.11
152  "~:{~2,v^~A~}" ('((#\x 1))) "1")
153
154(def-format-test format.^.\:{.12
155  "~:{~v,v^~A~}" ('((1 2 0) (0 1 1) (1 0 2) (3 3 5) (4 5 6))) "0126")
156
157(def-format-test format.^.\:{.13
158  "~:{~v,v^~A~}" ('((1 2 0) (#\a #\A 1) (#\A #\A 2) (1 2 3))) "013")
159
160(def-format-test format.^.\:{.14
161  "~:{~'x,3^~A~}" ('((1))) "1")
162
163(def-format-test format.^.\:{.15
164  "~:{~3,'x^~A~}" ('((1))) "1")
165
166(def-format-test format.^.\:{.16
167  "~:{~'x,'x^~A~}" ('((1))) "")
168
169(def-format-test format.^.\:{.17
170  "~:{~#,1^~A~}" ('((1)(2 10)(3 a b)(4)(5 x)(6)(7 8))) "2357")
171
172(def-format-test format.^.\:{.18
173  "~:{~1,#^~A~}" ('((1)(2 10)(3 a b)(4)(5 x)(6)(7 8))) "2357")
174
175(def-format-test format.^.\:{.19
176  "~:{~#,#^~A~}" ('((1)()(2 10)(3 a b)(4)(5 x)(6)(7 8))) "")
177
178(def-format-test format.^.\:{.20
179  "~:{~0,v^~A~}" ('((0 1)(1 2)(nil 3)(2 4))) "24")
180
181(def-format-test format.^.\:{.21
182  "~:{~1,v^~A~}" ('((0 1)(1 2)(nil 3)(2 4))) "134")
183
184(def-format-test format.^.\:{.22
185  "~:{~1,1,1^~A~}" ('((1)(2 3)(4 5 6)(7 8 9 0))) "")
186
187(def-format-test format.^.\:{.23
188  "~:{~1,2,3^~A~}" ('((1)(2 3)(4 5 6)(7 8 9 0))) "")
189
190(def-format-test format.^.\:{.24
191  "~:{~1,2,1^~A~}" ('((1)(2 3)(4 5 6)(7 8 9 0))) "1247")
192
193(def-format-test format.^.\:{.25
194  "~:{~1,0,1^~A~}" ('((1)(2 3)(4 5 6)(7 8 9 0))) "1247")
195
196(def-format-test format.^.\:{.26
197  "~:{~3,2,1^~A~}" ('((1)(2 3)(4 5 6)(7 8 9 0))) "1247")
198
199(def-format-test format.^.\:{.27
200  "~:{~v,2,3^~A~}" ('((1 10)(2 20)(3 30)(4 40))) "3040")
201
202(def-format-test format.^.\:{.28
203  "~:{~1,v,3^~A~}" ('((0 7)(1 10)(2 20)(3 30)(4 40))) "740")
204
205(def-format-test format.^.\:{.29
206  "~:{~1,2,v^~A~}" ('((0 0)(1 10)(2 20)(3 30)(4 40)(0 50))) "01050")
207
208(def-format-test format.^.\:{.30
209  "~:{~1,2,v^~A~}" ('((nil 0))) "0")
210
211(def-format-test format.^.\:{.31
212  "~:{~#,3,3^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "45")
213
214(def-format-test format.^.\:{.32
215  "~:{~2,#,3^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "145")
216
217(def-format-test format.^.\:{.33
218  "~:{~0,3,#^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "12")
219
220(def-format-test format.^.\:{.34
221  "~:{~#,#,3^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "45")
222
223(def-format-test format.^.\:{.35
224  "~:{~3,#,#^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "12")
225
226(def-format-test format.^.\:{.36
227  "~:{~#,3,#^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "1245")
228
229(def-format-test format.^.\:{.37
230  "~:{~#,#,#^~A~}" ('((1) (2 1) (3 2 1) (4 3 2 1) (5 4 3 2 1))) "")
231
232(def-format-test format.^.\:{.38
233  "~:{~1,v,v^~A~}" ('((#\a nil 0))) "0")
234
235(def-format-test format.^.\:{.39
236  "~:{~v,1,v^~A~}" ('((#\a nil 0))) "0")
237
238;;; Tests of ~^ inside ~@{ ... ~}
239
240(def-format-test format.^.@{.1
241  "~@{X ~A~^ Y ~A~^ ~}" (1 2 3 4 5) "X 1 Y 2 X 3 Y 4 X 5")
242
243(def-format-test format.^.@{.2
244  "~@{X ~A~^ Y ~A~^ ~}" (1 2 3 4) "X 1 Y 2 X 3 Y 4")
245
246(def-format-test format.^.@{.3
247  "~1@{~A~^~A~}" (1) "1")
248
249(def-format-test format.^.@{.4
250  "~0@{~A~^~A~}" (1) "" 1)
251
252(def-format-test format.^.@{.5
253  "~1@{~A~^~A~}" (1 2 3) "12" 1)
254
255(def-format-test format.^.@{.6
256  "~@{~A~A~0^~A~}" (1 2 3 4 5 6) "12" 4)
257
258(def-format-test format.^.@{.7
259  "~@{~A~A~v^~A~}" (1 2 3 4 5 6 0 7 8 9 10 11 12) "12456" 6)
260
261(def-format-test format.^.@{.8
262  "~@{~#,3^~A~}" (1 2 3 4 5 6 7 8 9 10) "1234567" 3)
263
264(def-format-test format.^.@{.9
265  "~@{~2,#^~A~}X~A" (1 2 3 4 5 6 7 8 9 10) "12345678X9" 1)
266
267(def-format-test format.^.@{.10
268  "~@{~#,#^~A~}" (1 2 3 4 5 6 7 8 9 10) "" 10)
269
270(def-format-test format.^.@{.11
271  "~@{~#,#,#^~A~}" (1 2 3 4 5 6 7 8 9 10) "" 10)
272
273(def-format-test format.^.@{.12
274  "~@{~#,1,2^~A~}" (1 2 3 4 5 6 7 8 9 10) "123456789" 1)
275
276(def-format-test format.^.@{.13
277  "~@{~#,#,v^~A~}" (1 2 3 4 5 6 7 8 9 10) "246" 3)
278
279(def-format-test format.^.@{.14
280  "~@{~#,#,v^~A~}" (1 2 3 4 5 6 7 8 9 10 11) "246" 4)
281
282(def-format-test format.^.@{.15
283  "~@{~#,#,v^~A~}" (1 2 3 4 5 6 7 8 9 10 11 12) "246" 5)
284
285(def-format-test format.^.@{.16
286  "~@{~#,#,v^~A~}" (1 2 3 4 5 6 7 8 9 10 11 12 13) "246" 6)
287
288(def-format-test format.^.@{.17
289  "~@{~#,#,v^~A~}" (1 2 3 4 5 6 7 8 9 10 11 12 13 14) "2468" 5)
290
291(def-format-test format.^.@{.18
292  "~@{~v,v^~A~}"
293  ((1+ most-positive-fixnum)
294   (1+ most-positive-fixnum)
295   1)
296  "" 1)
297
298(def-format-test format.^.@{.19
299  "~@{~0,v,v^~A~}"
300  ((1+ most-positive-fixnum)
301   (1+ most-positive-fixnum)
302   1)
303  "" 1)
304
305(def-format-test format.^.@{.20
306  "~@{~0,v,v^~A~}"
307  ((1+ most-positive-fixnum)
308   most-positive-fixnum
309   1)
310  "1")
311
312(def-format-test format.^.@{.21
313  "~@{~1,v^~A~}" (nil 8 nil 7 0 6 1 5) "876" 1)
314
315(def-format-test format.^.@{.22
316  "~@{~0,v^~A~}" (3 8 1 7 3 6 nil 5) "876" 1)
317
318(def-format-test format.^.@{.23
319  "~@{~1,2,v^~A~}" (0 1 0 2 0 3 3 4) "123" 1)
320
321(def-format-test format.^.@{.24
322  "~@{~1,2,v^~A~}" (0 1 0 2 0 3 nil 4) "1234")
323
324(def-format-test format.^.@{.25
325  "~@{~1,1,v^~A~}" (0 1 0 2 0 3 nil 4) "123" 1)
326
327(def-format-test format.^.@{.26
328  "~@{~'X^~A~}" (1 2 3) "123")
329
330(def-format-test format.^.@{.27
331  "~@{~v,'X^~A~}" (0 1 #\x 2 nil 3 #\X 4 0 5) "123" 3)
332
333(def-format-test format.^.@{.28
334  "~@{~'X,v^~A~}" (0 1 #\x 2 nil 3 #\X 4 0 5) "123" 3)
335
336(def-format-test format.^.@{.29
337  "~@{~v,v^~A~}" (0 2 1 #\x #\X 2 5 #\X 3 #\y #\y 4 1 2 5) "123" 4)
338
339(def-format-test format.^.@{.30
340  "~@{~',,',^~A~}" (1 2 3) "" 3)
341
342(def-format-test format.^.@{.31
343  "~@{~1,v,v^~A~}" (#\a nil 0) "0")
344
345(def-format-test format.^.@{.32
346  "~@{~v,1,v^~A~}" (#\a nil 0) "0")
347
348(def-format-test format.^.@{.33
349  "~@{~v,v,v^~A~}" (#\a #\a nil 0) "" 1)
350
351;;; Inside ~:@{
352
353(def-format-test format.^.\:@{.1
354  "~:@{~A~^~A~A~}" ('(1) '(2 3 4) '(5 6 7 8)) "1234567")
355
356(def-format-test format.^.\:@{.2
357  "~@:{~A~0^~A~A~}" ('(1) '(2 3 4) '(5 6 7 8)) "125")
358
359(def-format-test format.^.\:@{.3
360  "~:@{~#^~A~}" ('(1) '(2 3 4) () '(5 6 7 8) ()) "125")
361
362(def-format-test format.^.\:@{.4
363  "~@:{~#^~A~#^~A~#^~A~#^~A~}" ('(1) '(2 3 4) () '(5 6 7 8) ()) "12345678")
364
365(def-format-test format.^.\:@{.5
366  "~:@{~v^~A~}" ('(1 2 3) '(0) '(2 4) '(0 5) '(1 6 7 8)) "246")
367
368(def-format-test format.^.\:@{.6
369  "~:@{~v^~A~}" ('(nil) '(nil 1) '(1 2)) "12")
370
371(def-format-test format.^.\:@{.7
372  "~:@{~v^~A~}" ('(#\x 1) '(#\y 2) '(0 3) '(1 4)) "124")
373
374(def-format-test format.^.\:@{.8
375  "~:@{~v,3^~A~}" ('(1 1) '(2 0) '(3 4) '(5 6)) "106")
376
377(def-format-test format.^.\:@{.9
378  "~@:{~3,v^~A~}" ('(1 1) '(2 0) '(3 4) '(5 6)) "106")
379
380(def-format-test format.^.\:@{.10
381  "~:@{~v,3^~A~}" ('(#\x 1)) "1")
382
383(def-format-test format.^.\:@{.11
384  "~:@{~2,v^~A~}" ('(#\x 1)) "1")
385
386(def-format-test format.^.\:@{.12
387  "~:@{~v,v^~A~}" ('(1 2 0) '(0 1 1) '(1 0 2) '(3 3 5) '(4 5 6)) "0126")
388
389(def-format-test format.^.\:@{.13
390  "~:@{~v,v^~A~}" ('(1 2 0) '(#\a #\A 1) '(#\A #\A 2) '(1 2 3)) "013")
391
392(def-format-test format.^.\:@{.14
393  "~:@{~'x,3^~A~}" ('(1)) "1")
394
395(def-format-test format.^.\:@{.15
396  "~:@{~3,'x^~A~}" ('(1)) "1")
397
398(def-format-test format.^.\:@{.16
399  "~:@{~'x,'x^~A~}" ('(1)) "")
400
401(def-format-test format.^.\:@{.17
402  "~:@{~#,1^~A~}" ('(1) '(2 10) '(3 a b) '(4) '(5 x) '(6) '(7 8)) "2357")
403
404(def-format-test format.^.\:@{.18
405  "~:@{~1,#^~A~}" ('(1) '(2 10) '(3 a b) '(4) '(5 x) '(6) '(7 8)) "2357")
406
407(def-format-test format.^.\:@{.19
408  "~:@{~#,#^~A~}" ('(1) '() '(2 10) '(3 a b) '(4) '(5 x) '(6) '(7 8)) "")
409
410(def-format-test format.^.\:@{.20
411  "~:@{~0,v^~A~}" ('(0 1) '(1 2) '(nil 3) '(2 4)) "24")
412
413(def-format-test format.^.\:@{.21
414  "~:@{~1,v^~A~}" ('(0 1) '(1 2) '(nil 3) '(2 4)) "134")
415
416(def-format-test format.^.\:@{.22
417  "~:@{~1,1,1^~A~}" ('(1) '(2 3) '(4 5 6) '(7 8 9 0)) "")
418
419(def-format-test format.^.\:@{.23
420  "~:@{~1,2,3^~A~}" ('(1) '(2 3) '(4 5 6) '(7 8 9 0)) "")
421
422(def-format-test format.^.\:@{.24
423  "~:@{~1,2,1^~A~}" ('(1) '(2 3) '(4 5 6) '(7 8 9 0)) "1247")
424
425(def-format-test format.^.\:@{.25
426  "~:@{~1,0,1^~A~}" ('(1) '(2 3) '(4 5 6) '(7 8 9 0)) "1247")
427
428(def-format-test format.^.\:@{.26
429  "~:@{~3,2,1^~A~}" ('(1) '(2 3) '(4 5 6) '(7 8 9 0)) "1247")
430
431(def-format-test format.^.\:@{.27
432  "~:@{~v,2,3^~A~}" ('(1 10) '(2 20) '(3 30) '(4 40)) "3040")
433
434(def-format-test format.^.\:@{.28
435  "~:@{~1,v,3^~A~}" ('(0 7) '(1 10) '(2 20) '(3 30) '(4 40)) "740")
436
437(def-format-test format.^.\:@{.29
438  "~:@{~1,2,v^~A~}" ('(0 0) '(1 10) '(2 20) '(3 30) '(4 40) '(0 50))
439  "01050")
440
441(def-format-test format.^.\:@{.30
442  "~:@{~1,2,v^~A~}" ('(nil 0)) "0")
443
444(def-format-test format.^.\:@{.31
445  "~:@{~#,3,3^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "45")
446
447(def-format-test format.^.\:@{.32
448  "~:@{~2,#,3^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "145")
449
450(def-format-test format.^.\:@{.33
451  "~:@{~0,3,#^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "12")
452
453(def-format-test format.^.\:@{.34
454  "~:@{~#,#,3^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "45")
455
456(def-format-test format.^.\:@{.35
457  "~:@{~3,#,#^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "12")
458
459(def-format-test format.^.\:@{.36
460  "~:@{~#,3,#^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "1245")
461
462(def-format-test format.^.\:@{.37
463  "~:@{~#,#,#^~A~}" ('(1) '(2 1) '(3 2 1) '(4 3 2 1) '(5 4 3 2 1)) "")
464
465(def-format-test format.^.\:@{.38
466  "~:@{~1,v,v^~A~}" ('(#\a nil 0)) "0")
467
468(def-format-test format.^.\:@{.39
469  "~:@{~v,1,v^~A~}" ('(#\a nil 0)) "0")
470
471;;; ~:^ in ~:{
472
473(def-format-test format.\:^.\:{.1
474  "~:{~:^~A~}"  (nil) "")
475
476(def-format-test format.\:^.\:{.2
477  "(~:{~A~:^,~})"  ('((1)(2)(3))) "(1,2,3)")
478
479(def-format-test format.\:^.\:{.3
480  "~:{~:^~A~}"  ('((1)(2)(3)(4))) "123")
481
482;;; arguments
483
484(def-format-test format.\:^.\:{.4
485  "~:{~0:^~A~}" ('((1)(2))) "")
486
487(def-format-test format.\:^.\:{.5
488  "~:{~1:^~A~}" ('((1)(2))) "12")
489
490(def-format-test format.\:^.\:{.6
491  "~:{~'X:^~A~}" ('((1)(2))) "12")
492
493(def-format-test format.\:^.\:{.7
494  "~:{~v:^~A~}" ('((1 8)(2 3 4)(3 1)(0)(6 7)(8 10))) "831")
495
496(def-format-test format.\:^.\:{.8
497  "~:{~V:^~A~}" ('((#\X 1)(0 2))) "1")
498
499(def-format-test format.\:^.\:{.9
500  "~:{~#:^~A~}" ('((1)(2)(3 4)(5 6 7)()(8 9 10))) "1235")
501
502(def-format-test format.\:^.\:{.10
503  "~:{~1,1:^~A~}" ('(()(1)(2 3))) "")
504
505(def-format-test format.\:^.\:{.11
506  "~:{~0,1:^~A~}" ('((1)(2 3))) "12")
507
508(def-format-test format.\:^.\:{.12
509  "~:{~v,1:^~A~}" ('((2 3)(4 5 6)(0 2)(1 7)(9 10))) "352")
510
511(def-format-test format.\:^.\:{.13
512  "~:{~1,V:^~A~}" ('((2 3)(4 5 6)(0 2)(1 7)(9 10))) "352")
513
514(def-format-test format.\:^.\:{.14
515  "~:{~V,v:^~A~}" ('((0 1 2) (1 0 3) (4 4) () (5 6 7))) "23")
516
517(def-format-test format.\:^.\:{.15
518  "~:{~#,1:^~A~}" ('((2 3 4)(4 5)(0)(1 7)(9 10)))
519  "24")
520
521(def-format-test format.\:^.\:{.16
522  "~:{~1,#:^~A~}" ('((2 3 4)(4 5)(0)(1 7)(9 10)))
523  "24")
524
525(def-format-test format.\:^.\:{.17
526  "~:{~#,#:^~A~}" ('(nil))
527  "")
528
529(def-format-test format.\:^.\:{.18
530  "~:{~#,#:^~A~}" ('((1)))
531  "")
532
533(def-format-test format.\:^.\:{.19
534  "~:{~#,v:^~A~}" ('((1 2)(3 4)(2 5 6)(1)(2)))
535  "245")
536
537(def-format-test format.\:^.\:{.20
538  "~:{~V,#:^~A~}" ('((0 2)(1 3 4)(1 3)()(0 7)))
539  "23")
540
541(def-format-test format.\:^.\:{.21
542  "~:{~'X,'Y:^~A~}" ('((1)(2)))
543  "12")
544
545(def-format-test format.\:^.\:{.22
546  "~:{~'X,'X:^~A~}" ('((1)(2)))
547  "")
548
549(def-format-test  format.\:^.\:{.23
550  "~:{~1,2,3:^~A~}" ('((1)(2)))
551  "")
552
553(def-format-test  format.\:^.\:{.24
554  "~:{~1,2,1:^~A~}" ('((1)(2)))
555  "12")
556
557(def-format-test  format.\:^.\:{.25
558  "~:{~2,1,3:^~A~}" ('((1)(2)))
559  "12")
560
561(def-format-test  format.\:^.\:{.26
562  "~:{~1,1,v:^~A~}" ('((0 4)(nil 1)(0 5)))
563  "4")
564
565(def-format-test  format.\:^.\:{.27
566  "~:{~v,2,2:^~A~}" ('((3 4)(1 1)(4 5)))
567  "4")
568
569(def-format-test  format.\:^.\:{.28
570  "~:{~1,v,2:^~A~}" ('((0 2)(3 4)(1 1)(4 5)))
571  "24")
572
573(def-format-test  format.\:^.\:{.29
574  "~:{~V,v,3:^~A~}" ('((1 4 0)(2 1 7)(4 4 8 0)(1 2 6)(9 8 0)))
575  "078")
576
577(def-format-test  format.\:^.\:{.30
578  "~:{~v,2,v:^~A~}" ('((1 1 0)(3 2 5)(2 1 6)(1 2 0)(10 11 13)))
579  "056")
580
581(def-format-test  format.\:^.\:{.31
582  "~:{~2,V,v:^~A~}" ('((1 1 0)(3 2 5)(2 1 6)(10 11 13)(0 1 0)))
583  "056")
584
585(def-format-test  format.\:^.\:{.32
586  "~:{~v,v,V:^~A~}" ('((1 2 1 0)(2 1 1 4)(2 3 1 6)(1 2 3)(0 1 0 8)))
587  "046")
588
589(def-format-test  format.\:^.\:{.33
590  "~:{~#,2,2:^~A~}" ('((1 2 3)(2 X X)(0 A B C D)(4 5)(5 7 8 9)))
591  "120")
592
593(def-format-test  format.\:^.\:{.34
594  "~:{~2,#,3:^~A~}" ('((1)(2 3 4 5)(3 4)(4 5 6 7 8)()))
595  "12")
596
597(def-format-test  format.\:^.\:{.35
598  "~:{~1,3,#:^~A~}" ('((1)(2 3)(3 4)(4 5 6)(5)))
599  "123")
600
601(def-format-test  format.\:^.\:{.36
602  "~:{~#,#,2:^~A~}" ('((1 2 3)(2 X X)(0 A B C D)(4 5)(5 7 8 9)))
603  "120")
604
605(def-format-test  format.\:^.\:{.37
606  "~:{~3,#,#:^~A~}" ('((1)(2 3)(3 4)(4 5 6)(5)))
607  "123")
608
609(def-format-test  format.\:^.\:{.38
610  "~:{~#,2,#:^~A~}" ('((1 2 3)(2)(0 A B C D)(4 5)(5 7 8 9)))
611  "120")
612
613(def-format-test  format.\:^.\:{.39
614  "~:{~#,#,#:^~A~}" ('((1 2 3)(2)(0 A B C D)(4 5)(5 7 8 9)))
615  "")
616
617;;; ~:^ in ~:@{
618
619(def-format-test format.\:^.\:@{.1
620  "~:@{~:^~A~}" nil "")
621
622(def-format-test format.\:^.\:@{.2
623  "(~:@{~A~:^,~})" ('(1) '(2) '(3))
624  "(1,2,3)")
625
626(def-format-test format.\:^.\:@{.3
627  "~:@{~:^~A~}" ('(1) '(2) '(3) '(4))
628  "123")
629
630(def-format-test format.\:^.\:@{.4
631  "~:@{~0:^~A~}" ('(1) '(2))
632  "" 1)
633
634(def-format-test format.\:^.\:@{.5
635  "~:@{~1:^~A~}" ('(1) '(2))
636  "12")
637
638(def-format-test format.\:^.\:@{.6
639  "~:@{~'X:^~A~}" ('(1) '(2))
640  "12")
641
642(def-format-test format.\:^.\:@{.7
643  "~:@{~v:^~A~}" ('(1 8) '(2 3 4) '(3 1) '(0) '(6 7) '(8 10))
644  "831" 2)
645
646(def-format-test format.\:^.\:@{.8
647  "~:@{~V:^~A~}" ('(#\X 1) '(0 2))
648  "1")
649
650(def-format-test format.\:^.\:@{.9
651  "~:@{~#:^~A~}" ('(1) '(2) '(3 4) '(5 6 7) () '(8 9 10))
652  "1235" 1)
653
654(def-format-test format.\:^.\:@{.10
655  "~:@{~1,1:^~A~}" (() '(1) '(2 3))
656  "" 2)
657
658(def-format-test format.\:^.\:@{.11
659  "~:@{~0,1:^~A~}" ('(1) '(2 3))
660  "12")
661
662(def-format-test format.\:^.\:@{.12
663  "~:@{~v,1:^~A~}" ('(2 3) '(4 5 6) '(0 2) '(1 7) '(9 10))
664  "352" 1)
665
666(def-format-test format.\:^.\:@{.13
667  "~:@{~1,V:^~A~}" ('(2 3) '(4 5 6) '(0 2) '(1 7) '(9 10))
668  "352" 1)
669
670(def-format-test format.\:^.\:@{.14
671  "~:@{~V,v:^~A~}" ('(0 1 2) '(1 0 3) '(4 4) () '(5 6 7))
672  "23" 2)
673
674(def-format-test format.\:^.\:@{.15
675  "~:@{~#,1:^~A~}" ('(2 3 4) '(4 5) '(0) '(1 7) '(9 10))
676  "24" 2)
677
678(def-format-test format.\:^.\:@{.16
679  "~:@{~1,#:^~A~}" ('(2 3 4) '(4 5) '(0) '(1 7) '(9 10))
680  "24" 2)
681
682(def-format-test format.\:^.\:@{.17
683  "~:@{~#,#:^~A~}" (nil)
684  "")
685
686(def-format-test format.\:^.\:@{.18
687  "~:@{~#,#:^~A~}" ('(1))
688  "")
689
690(def-format-test format.\:^.\:@{.19
691  "~:@{~#,v:^~A~}" ('(1 2) '(3 4) '(2 5 6) '(1) '(2))
692  "245" 1)
693
694(def-format-test format.\:^.\:@{.20
695  "~:@{~V,#:^~A~}" ('(0 2) '(1 3 4) '(1 3) () '(0 7))
696  "23" 2)
697
698(def-format-test format.\:^.\:@{.21
699  "~:@{~'X,'Y:^~A~}" ('(1) '(2))
700  "12")
701
702(def-format-test format.\:^.\:@{.22
703  "~:@{~'X,'X:^~A~}" ('(1) '(2))
704  "" 1)
705
706(def-format-test  format.\:^.\:@{.23
707  "~:@{~1,2,3:^~A~}" ('(1) '(2))
708  "" 1)
709
710(def-format-test  format.\:^.\:@{.24
711  "~:@{~1,2,1:^~A~}" ('(1) '(2))
712  "12")
713
714(def-format-test  format.\:^.\:@{.25
715  "~:@{~2,1,3:^~A~}" ('(1) '(2))
716  "12")
717
718(def-format-test  format.\:^.\:@{.26
719  "~:@{~1,1,v:^~A~}" ('(0 4) '(nil 1) '(0 5))
720  "4" 1)
721
722(def-format-test  format.\:^.\:@{.27
723  "~:@{~v,2,2:^~A~}" ('(3 4) '(1 1) '(4 5))
724  "4" 1)
725
726(def-format-test  format.\:^.\:@{.28
727  "~:@{~1,v,2:^~A~}" ('(0 2) '(3 4) '(1 1) '(4 5))
728  "24" 1)
729
730(def-format-test  format.\:^.\:@{.29
731  "~:@{~V,v,3:^~A~}" ('(1 4 0) '(2 1 7) '(4 4 8 0) '(1 2 6) '(9 8 0))
732  "078" 1)
733
734(def-format-test  format.\:^.\:@{.30
735  "~:@{~v,2,v:^~A~}" ('(1 1 0) '(3 2 5) '(2 1 6) '(1 2 0) '(10 11 13))
736  "056" 1)
737
738(def-format-test  format.\:^.\:@{.31
739  "~:@{~2,V,v:^~A~}" ('(1 1 0) '(3 2 5) '(2 1 6) '(10 11 13) '(0 1 0))
740  "056" 1)
741
742(def-format-test  format.\:^.\:@{.32
743  "~:@{~v,v,V:^~A~}" ('(1 2 1 0) '(2 1 1 4) '(2 3 1 6) '(1 2 3) '(0 1 0 8))
744  "046" 1)
745
746(def-format-test  format.\:^.\:@{.33
747  "~:@{~#,2,2:^~A~}" ('(1 2 3) '(2 X X) '(0 A B C D) '(4 5) '(5 7 8 9))
748  "120" 1)
749
750(def-format-test  format.\:^.\:@{.34
751  "~:@{~2,#,3:^~A~}" ('(1) '(2 3 4 5) '(3 4) '(4 5 6 7 8) ())
752  "12" 2)
753
754(def-format-test  format.\:^.\:@{.35
755  "~:@{~1,3,#:^~A~}" ('(1) '(2 3) '(3 4) '(4 5 6) '(5))
756  "123" 1)
757
758(def-format-test  format.\:^.\:@{.36
759  "~:@{~#,#,2:^~A~}" ('(1 2 3) '(2 X X) '(0 A B C D) '(4 5) '(5 7 8 9))
760  "120" 1)
761
762(def-format-test  format.\:^.\:@{.37
763  "~:@{~3,#,#:^~A~}" ('(1) '(2 3) '(3 4) '(4 5 6) '(5))
764  "123" 1)
765
766(def-format-test  format.\:^.\:@{.38
767  "~:@{~#,2,#:^~A~}" ('(1 2 3) '(2) '(0 A B C D) '(4 5) '(5 7 8 9))
768  "120" 1)
769
770(def-format-test  format.\:^.\:@{.39
771  "~:@{~#,#,#:^~A~}" ('(1 2 3) '(2) '(0 A B C D) '(4 5) '(5 7 8 9))
772  "" 4)
773
774;;; ~^ inside ~?, ~@?
775
776(def-format-test format.^.?.1
777  "~AY~?X~A" (1 "~A~0^~A" '(2 4) 3)
778  "1Y2X3")
779
780(def-format-test format.^.?.2
781  "~AY~?X~A" (1 "~A~^~A" '(2) 3)
782  "1Y2X3")
783
784(def-format-test format.^.?.3
785  "~AY~?X~A" (1 "~A~^~A~^~A" '(2 4) 3)
786  "1Y24X3")
787
788(def-format-test format.^.?.4
789  "~A~?X~A" (1 "~{~^~A~}~AY~A" '((2 3) 4 5) 6)
790  "1234Y5X6")
791
792(def-format-test format.^.@?.1
793  "~AY~@?X~A" (1 "~A~0^~A" 2 3 4)
794  "1Y2X3" 1)
795
796(def-format-test format.^.@?.2
797  "~A~@?X~A" (1 "~{~^~A~}~AY~A" '(2 3) 4 5 6)
798  "1234Y5X6")
799
800;;; ~^ in ~[
801
802(def-format-test format.^.\[.1
803  "~{~[X~;Y~;Z~;~0^~]~}" ('(0 1 2 3 4))
804  "XYZ")
805
806(def-format-test format.^.\[.2
807  "~{~[X~;Y~;Z~:;~0^~]~}" ('(1 0 2 8 9 10 0))
808  "YXZ")
809
810(def-format-test format.^.\[.3
811  "~{~[X~;Y~0^NO~;Z~;~^~]~}" ('(0 1 2 3 4))
812  "XY")
813
814;;; ~^ in ~(
815
816(def-format-test format.^.\(.1
817  "~{~(~C~C~0^~C~)W~}" ('(#\X #\Y #\Z #\A))
818  "xy")
819
820(def-format-test format.^.\:\(.1
821  "~{~:(~C~C~0^~C~)U~}" ('(#\X #\Y #\Z #\A))
822  "Xy")
823
824(def-format-test format.^.@\(.1
825  "~{~@(~CA ~Cb ~0^~C~)V~}" ('(#\x #\y #\Z #\A))
826  "Xa yb ")
827
828(def-format-test format.^.@\:\(.1
829  "~{~@:(~CA ~Cb ~0^~C~)W~}" ('(#\x #\Y #\Z #\A))
830  "XA YB ")
Note: See TracBrowser for help on using the repository browser.