Add copyright and licence notices to files which lack them.
[pspp] / tests / output / render.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl # +-+---+-+-+-+
17 # |a|bcd|e|f|i|
18 # +-+-+-+-+g+-+
19 # |j|m|nop|h|q|
20 # |k+-+-+-+-+r|
21 # |l|t|w|xyz|s|
22 # +-+u+-+-+-+-+
23 # |A|v|B|E|FGH|
24 # +-+-+C+-+-+-+
25 # |IJK|D|L|O|P|
26 # +-+-+-+M+-+-+
27 # |Q|RST|N|U|V|
28 # +-+---+-+-+-+
29 m4_define([WEAVE_6X6],
30   [6 6 $1
31 @a
32 1*2 @bcd
33 @e
34 2*1 @f\ng\nh
35 @i
36 2*1 @j\nk\nl
37 @m
38 1*2 @nop
39 2*1 @q\nr\ns
40 2*1 @t\nu\nv
41 @w
42 1*2 @xyz
43 @A
44 2*1 @B\nC\nD
45 @E
46 1*2 @FGH
47 1*2 @IJK
48 2*1 @L\nM\nN
49 @O
50 @P
51 @Q
52 1*2 @RST
53 @U
54 @V
55 ])
56
57 # +-+-+-+-+-+-+-+-+
58 # |a|b|c|d|e|f|g|h|
59 # +-+-+-+-+-+-+-+-+
60 # |i|jkl|m|nop|q|t|
61 # +-+-+-+-+-+-+r+-+
62 # |u|v|wxy|z|A|s|D|
63 # +-+-+-+-+-+B+-+-+
64 # |E|F|I|JKL|C|M|P|
65 # +-+G+-+---+-+N+-+
66 # |Q|H|R|UVW|X|O|Y|
67 # +-+-+S+-+-+-+-+-+
68 # |Z|0|T|3|456|7|8|
69 # +-+1+-+-+-+-+-+-+
70 # |9|2|abc|d|efg|h|
71 # +-+-+-+-+-+-+-+-+
72 # |i|j|k|l|m|n|o|p|
73 # +-+-+-+-+-+-+-+-+
74 m4_define([WEAVE_8X8],
75   [8 8 $1
76 @a
77 @b
78 @c
79 @d
80 @e
81 @f
82 @g
83 @h
84 @i
85 1*2 @jkl
86 @m
87 1*2 @nop
88 2*1 @q\nr\ns
89 @t
90 @u
91 @v
92 1*2 @wxy
93 @z
94 2*1 @A\nB\nC
95 @D
96 @E
97 2*1 @F\nG\nH
98 @I
99 1*2 @JKL
100 2*1 @M\nN\nO
101 @P
102 @Q
103 2*1 @R\nS\nT
104 1*2 @UVW
105 @X
106 @Y
107 @Z
108 2*1 @0\n1\n2
109 @3
110 1*2 @456
111 @7
112 @8
113 @9
114 1*2 @abc
115 @d
116 1*2 @efg
117 @h
118 @i
119 @j
120 @k
121 @l
122 @m
123 @n
124 @o
125 @p
126 ])
127
128 # This input is something of a counterexample, in that it could render
129 # compactly as this if the algorithm for choosing cell widths and
130 # heights were smarter:
131 #
132 # +---+---+---+-+-+
133 # |abc|jkl|mno|v|x|
134 # |def+---+pqr+-+-+
135 # |ghi|yzA|stu|HIJ|
136 # +-+-+BCD+-+-+KLM|
137 # |Q|V|EFG|W|Z|NOP|
138 # |R+-+-+-+X+-+-+-+
139 # |S|012|9|Y|abc|j|
140 # |T|345+-+-+def|k|
141 # |U|678|opq|ghi|l|
142 # +-+-+-+rst+---+m|
143 # |xyz|G|uvw|JKL|n|
144 # |ABC|H+---+-+-+-+
145 # |DEF|I|MNOPQ|123|
146 # +---+-+RSTUV|456|
147 # |abcde|WXYZ0|789|
148 # +-----+-----+---+
149 m4_define([WEAVE_8X8_2],
150   [8 8 $1
151 2*2 @abc\ndef\nghi
152 1*2 @jkl
153 2*2 @mno\npqr\nstu
154 1*2 @vwx
155 2*2 @yzA\nBCD\nEFG
156 2*2 @HIJ\nKLM\nNOP
157 3*1 @Q\nR\nS\nT\nU
158 @V
159 2*1 @W\nX\nY
160 @Z
161 2*2 @012\n345\n678
162 @9
163 2*2 @abc\ndef\nghi
164 3*1 @j\nk\nl\nm\nn
165 2*2 @opq\nrst\nuvw
166 2*2 @xyz\nABC\nDEF
167 2*1 @G\nH\nI
168 1*2 @JKL
169 2*3 @MNOPQ\nRSTUV\nWXYZ0
170 2*2 @123\n456\n789
171 1*3 @abcde
172 ])
173 \f
174 AT_BANNER([output rendering -- no page breaking])
175
176 AT_SETUP([single cell])
177 AT_KEYWORDS([render rendering])
178 AT_DATA([input], [1 1
179 abc
180 ])
181 AT_CHECK([render-test input], [0], [abc
182 ])
183 AT_CLEANUP
184
185 AT_SETUP([nested single cell])
186 AT_KEYWORDS([render rendering])
187 AT_DATA([input], [1 1
188 abc
189 1 1
190 {0}
191 ])
192 AT_CHECK([render-test input], [0], [abc
193 ])
194 AT_CLEANUP
195
196 AT_SETUP([single cell with border])
197 AT_KEYWORDS([render rendering])
198 AT_DATA([input], [1 1
199 @abc
200 ])
201 AT_CHECK([render-test input], [0], [dnl
202 +---+
203 |abc|
204 +---+
205 ])
206 AT_CLEANUP
207
208 AT_SETUP([nested single cell with border])
209 AT_KEYWORDS([render rendering])
210 AT_DATA([input], [1 1
211 @abc
212 1 1
213 @{0}
214 ])
215 AT_CHECK([render-test input], [0], [dnl
216 +-----+
217 |+---+|
218 ||abc||
219 |+---+|
220 +-----+
221 ])
222 AT_CLEANUP
223
224 AT_SETUP([joined columns])
225 AT_KEYWORDS([render rendering])
226 AT_DATA([input], [2 2
227 1*2 @abcdefg
228 @hij
229 @klm
230 ])
231 AT_CHECK([render-test input], [0], [dnl
232 +-------+
233 |abcdefg|
234 +---+---+
235 |hij|klm|
236 +---+---+
237 ])
238 AT_CLEANUP
239
240 AT_SETUP([3x3, joined rows and columns])
241 AT_KEYWORDS([render rendering])
242 AT_DATA([input], [3 3
243 1*2 @abc
244 2*1 @d\ne\nf
245 2*1 @g\nh\ni
246 @j
247 1*2 @klm
248 ])
249 AT_CHECK([render-test input], [0], [dnl
250 +---+-+
251 |abc|d|
252 +-+-+e|
253 |g|j|f|
254 |h+-+-+
255 |i|klm|
256 +-+---+
257 ])
258 AT_CLEANUP
259
260 AT_SETUP([joined rows and columns (with footnotes)])
261 AT_KEYWORDS([render rendering footnote])
262 AT_DATA([input], [3 3
263 1*2 @abc#Approximation.
264 2*1 @d\ne\nf#This is a very long footnote that will have to wrap from one line to the next.  Let's see if the rendering engine does it acceptably.
265 2*1 @g\nh\ni#One#Two#Three
266 @j
267 1*2 @klm
268 ])
269 AT_CHECK([render-test --csv input], [0],
270 [[+------------+----+
271 |      abc[a]|   d|
272 +----------+-+   e|
273 |         g|j|f[b]|
274 |         h+-+----+
275 |i[c][d][e]|   klm|
276 +----------+------+
277 [a] Approximation.
278 [b] This is a very long footnote that will have to wrap from one line to the
279     next.  Let's see if the rendering engine does it acceptably.
280 [c] One
281 [d] Two
282 [e] Three
283 ]])
284 AT_CHECK([cat render.csv], [0],
285 [[abc[a],,"d
286 e
287 f[b]"
288 "g
289 h
290 i[c][d][e]",j,
291 ,klm,
292
293 Footnotes:
294 a,Approximation.
295 b,This is a very long footnote that will have to wrap from one line to the next.  Let's see if the rendering engine does it acceptably.
296 c,One
297 d,Two
298 e,Three
299 ]])
300 AT_CLEANUP
301
302 AT_SETUP([6x6, joined rows and columns])
303 AT_KEYWORDS([render rendering])
304 AT_DATA([input], [WEAVE_6X6])
305 AT_CHECK([render-test input], [0], [dnl
306 +-+---+-+-+-+
307 |a|bcd|e|f|i|
308 +-+-+-+-+g+-+
309 |j|m|nop|h|q|
310 |k+-+-+-+-+r|
311 |l|t|w|xyz|s|
312 +-+u+-+-+-+-+
313 |A|v|B|E|FGH|
314 +-+-+C+-+-+-+
315 |IJK|D|L|O|P|
316 +-+-+-+M+-+-+
317 |Q|RST|N|U|V|
318 +-+---+-+-+-+
319 ])
320 AT_CLEANUP
321
322 AT_SETUP([3 rows with many joined cells])
323 AT_KEYWORDS([render rendering])
324 AT_CAPTURE_FILE([input])
325 AT_DATA([input], [3 19
326 m4_foreach([x], [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s], [x
327 ])@1
328 m4_for([x], [2], [19], [1], [1*2 @x
329 ])@20
330 ])
331 AT_CHECK([render-test input], [0], [dnl
332  a b c d e f g h i j k l m n o p q r  s
333 +-+---+---+---+---+---+---+---+---+----+
334 |1|  2|  3|  4|  5|  6|  7|  8|  9|  10|
335 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+
336 | 11| 12| 13| 14| 15| 16| 17| 18| 19|20|
337 +---+---+---+---+---+---+---+---+---+--+
338 ])
339 AT_CLEANUP
340
341 AT_SETUP([3 columns with many joined cells])
342 AT_KEYWORDS([render rendering])
343 AT_CAPTURE_FILE([input])
344 AT_DATA([input], [3 19
345 m4_foreach([x], [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s], [x
346 ])@1
347 m4_for([x], [2], [19], [1], [1*2 @x\nab\ncd
348 ])@20
349 ])
350 AT_CHECK([render-test --transpose input], [0], [dnl
351  +--+--+
352 a| 1|11|
353  +--+ab|
354 b| 2|cd|
355  |ab+--+
356 c|cd|12|
357  +--+ab|
358 d| 3|cd|
359  |ab+--+
360 e|cd|13|
361  +--+ab|
362 f| 4|cd|
363  |ab+--+
364 g|cd|14|
365  +--+ab|
366 h| 5|cd|
367  |ab+--+
368 i|cd|15|
369  +--+ab|
370 j| 6|cd|
371  |ab+--+
372 k|cd|16|
373  +--+ab|
374 l| 7|cd|
375  |ab+--+
376 m|cd|17|
377  +--+ab|
378 n| 8|cd|
379  |ab+--+
380 o|cd|18|
381  +--+ab|
382 p| 9|cd|
383  |ab+--+
384 q|cd|19|
385  +--+ab|
386 r|10|cd|
387  |ab+--+
388 s|cd|20|
389  +--+--+
390 ])
391 AT_CLEANUP
392
393 AT_SETUP([joined rows])
394 AT_KEYWORDS([render rendering])
395 AT_DATA([input], [2 2
396 2*1 @ab\ncd\nef
397 @hij
398 @klm
399 ])
400 AT_CHECK([render-test input], [0], [dnl
401 +--+---+
402 |ab|hij|
403 |cd+---+
404 |ef|klm|
405 +--+---+
406 ])
407 AT_CLEANUP
408
409 AT_SETUP([nested joined rows])
410 AT_KEYWORDS([render rendering])
411 AT_DATA([input], [2 2
412 2*1 @ab\ncd\nef
413 @hij
414 @klm
415 1 1
416 @{0}
417 ])
418 AT_CHECK([render-test input], [0], [dnl
419 +--------+
420 |+--+---+|
421 ||ab|hij||
422 ||cd+---+|
423 ||ef|klm||
424 |+--+---+|
425 +--------+
426 ])
427 AT_CLEANUP
428
429 dnl This checks for bug #31346, a segmentation fault that surfaced
430 dnl when two or more rows  had no unspanned cells and no rules.
431 AT_SETUP([joined rows only, no rules])
432 AT_KEYWORDS([render rendering])
433 AT_DATA([input], [2 2
434 2*1 ab\ncd\nef
435 2*1 hij\nklm\nnop
436 ])
437 AT_CHECK([render-test input], [0], [dnl
438 ab hij
439 cd klm
440 ef nop
441 ])
442 AT_CLEANUP
443
444 AT_SETUP([joined columns only, no rules])
445 AT_KEYWORDS([render rendering])
446 AT_DATA([input], [2 2
447 1*2 abc\ndef
448 1*2 hij\nklm\nnop
449 ])
450 AT_CHECK([render-test input], [0], [dnl
451 abc
452 def
453 hij
454 klm
455 nop
456 ])
457 AT_CLEANUP
458
459 AT_SETUP([5 big narrow cells])
460 AT_KEYWORDS([render rendering])
461 AT_DATA([input], [1 5
462 @This cell has a lot of text but its minimum width is pretty narrow.
463 @This cell also has a lot of text but its minimum width is pretty narrow.
464 @A third cell with a lot of text but a pretty narrow minimum width.
465 @A fourth cell with a lot of text but a pretty narrow minimum width.
466 @A fifth cell with a lot of text but a pretty narrow minimum width.
467 ])
468 AT_CHECK([render-test input], [0], [dnl
469 +---------------+---------------+--------------+---------------+--------------+
470 |This cell has a| This cell also|  A third cell|  A fourth cell|  A fifth cell|
471 |lot of text but|   has a lot of| with a lot of|  with a lot of| with a lot of|
472 |    its minimum|   text but its|    text but a|     text but a|    text but a|
473 |width is pretty|  minimum width| pretty narrow|  pretty narrow| pretty narrow|
474 |        narrow.|      is pretty|minimum width.| minimum width.|minimum width.|
475 |               |        narrow.|              |               |              |
476 +---------------+---------------+--------------+---------------+--------------+
477 ])
478 AT_CLEANUP
479
480 AT_SETUP([9 big narrow cells])
481 AT_KEYWORDS([render rendering])
482 AT_DATA([input], [1 9
483 @This cell has a lot of text but its minimum width is pretty narrow.
484 @This cell also has a lot of text but its minimum width is pretty narrow.
485 @A third cell with a lot of text but a pretty narrow minimum width.
486 @A fourth cell with a lot of text but a pretty narrow minimum width.
487 @A fifth cell with a lot of text but a pretty narrow minimum width.
488 @A sixth cell with a lot of text but a pretty narrow minimum width.
489 @A seventh cell with a lot of text but a pretty narrow minimum width.
490 @A eighth cell with a lot of text but a pretty narrow minimum width.
491 @A ninth cell with a lot of text but a pretty narrow minimum width.
492 ])
493 AT_CHECK([render-test input], [0], [dnl
494 +--------+-------+--------+--------+-------+--------+--------+-------+--------+
495 |    This|   This| A third|A fourth|A fifth| A sixth|       A|      A| A ninth|
496 |cell has|   cell|    cell|    cell|   cell|    cell| seventh| eighth|    cell|
497 |a lot of|   also|  with a|  with a| with a|  with a|    cell|   cell|  with a|
498 |text but|  has a|  lot of|  lot of| lot of|  lot of|  with a| with a|  lot of|
499 |     its| lot of|text but|text but|   text|text but|  lot of| lot of|text but|
500 | minimum|   text|a pretty|a pretty|  but a|a pretty|text but|   text|a pretty|
501 |width is|but its|  narrow|  narrow| pretty|  narrow|a pretty|  but a|  narrow|
502 |  pretty|minimum| minimum| minimum| narrow| minimum|  narrow| pretty| minimum|
503 | narrow.|  width|  width.|  width.|minimum|  width.| minimum| narrow|  width.|
504 |        |     is|        |        | width.|        |  width.|minimum|        |
505 |        | pretty|        |        |       |        |        | width.|        |
506 |        |narrow.|        |        |       |        |        |       |        |
507 +--------+-------+--------+--------+-------+--------+--------+-------+--------+
508 ])
509 AT_CLEANUP
510
511 AT_SETUP([2 big cells with new-lines])
512 AT_KEYWORDS([render rendering])
513 AT_DATA([input], [1 2
514 @PSPP does not place many restrictions on ordering of commands. The main restriction is that variables must be defined before they are otherwise referenced.  This section describes the details of command ordering, but most users will have no need to refer to them. PSPP possesses five internal states, called initial, INPUT PROGRAM, FILE TYPE, transformation, and procedure states.
515 @PSPP includes special support\nfor unknown numeric data values.\nMissing observations are assigned\na special value, called the\n``system‑missing value''.  This\n``value'' actually indicates the\nabsence of a value; it\nmeans that the actual\nvalue is unknown.
516 ])
517 AT_CHECK([render-test input], [0], [dnl
518 +----------------------------------------------------------+------------------+
519 |      PSPP does not place many restrictions on ordering of|     PSPP includes|
520 |  commands. The main restriction is that variables must be|   special support|
521 |       defined before they are otherwise referenced.  This|       for unknown|
522 |    section describes the details of command ordering, but|      numeric data|
523 |       most users will have no need to refer to them. PSPP|           values.|
524 |     possesses five internal states, called initial, INPUT|           Missing|
525 | PROGRAM, FILE TYPE, transformation, and procedure states.|  observations are|
526 |                                                          |          assigned|
527 |                                                          |  a special value,|
528 |                                                          |        called the|
529 |                                                          |  ``system‑missing|
530 |                                                          |    value''.  This|
531 |                                                          |``value'' actually|
532 |                                                          |     indicates the|
533 |                                                          |      absence of a|
534 |                                                          |         value; it|
535 |                                                          |    means that the|
536 |                                                          |            actual|
537 |                                                          | value is unknown.|
538 +----------------------------------------------------------+------------------+
539 ])
540 AT_CLEANUP
541
542 AT_SETUP([8x8 with many 2x2 joins])
543 AT_KEYWORDS([render rendering])
544 AT_DATA([input], [WEAVE_8X8_2])
545 AT_CHECK([render-test input], [0],[dnl
546 +---+---+----+----+
547 |abc|jkl| mno| vwx|
548 |def|   | pqr|    |
549 |ghi+---+ stu+----+
550 |   |yzA|    | HIJ|
551 +-+-+BCD+-+--+ KLM|
552 |Q|V|EFG|W| Z| NOP|
553 |R| |   |X|  |    |
554 |S+-+-+-+Y+--+-+--+
555 |T|012|9| | abc| j|
556 |U|345| | | def| k|
557 | |678+-+-+ ghi| l|
558 | |   |opq|    | m|
559 +-+-+-+rst+----+ n|
560 |xyz|G|uvw| JKL|  |
561 |ABC|H|   |    |  |
562 |DEF|I+---+--+-+--+
563 |   | | MNOPQ| 123|
564 +---+-+ RSTUV| 456|
565 |abcde| WXYZ0| 789|
566 |     |      |    |
567 +-----+------+----+
568 ])
569 AT_CLEANUP
570
571 AT_SETUP([nested 8x8])
572 AT_KEYWORDS([render rendering])
573 AT_DATA([input], [WEAVE_8X8[]dnl
574 1 1
575 @{0}
576 ])
577 AT_CHECK([render-test input], [0], [dnl
578 +-----------------+
579 |+-+-+-+-+-+-+-+-+|
580 ||a|b|c|d|e|f|g|h||
581 |+-+-+-+-+-+-+-+-+|
582 ||i|jkl|m|nop|q|t||
583 |+-+-+-+-+-+-+r+-+|
584 ||u|v|wxy|z|A|s|D||
585 |+-+-+-+-+-+B+-+-+|
586 ||E|F|I|JKL|C|M|P||
587 |+-+G+-+---+-+N+-+|
588 ||Q|H|R|UVW|X|O|Y||
589 |+-+-+S+-+-+-+-+-+|
590 ||Z|0|T|3|456|7|8||
591 |+-+1+-+-+-+-+-+-+|
592 ||9|2|abc|d|efg|h||
593 |+-+-+-+-+-+-+-+-+|
594 ||i|j|k|l|m|n|o|p||
595 |+-+-+-+-+-+-+-+-+|
596 +-----------------+
597 ])
598 AT_CLEANUP
599
600 AT_SETUP([nested 8x8s and 6x6s])
601 AT_KEYWORDS([render rendering])
602 AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl
603 4 2
604 @{0}
605 @{1}
606 @{1}
607 @|{1}
608 @|{1}
609 @({1}
610 @({1}
611 @{0}
612 ])
613 AT_CHECK([render-test input], [0], [dnl
614 +-----------------+-----------------+
615 |+-+-+-+-+-+-+-+-+|    +-+---+-+-+-+|
616 ||a|b|c|d|e|f|g|h||    |a|bcd|e|f|i||
617 |+-+-+-+-+-+-+-+-+|    +-+-+-+-+g+-+|
618 ||i|jkl|m|nop|q|t||    |j|m|nop|h|q||
619 |+-+-+-+-+-+-+r+-+|    |k+-+-+-+-+r||
620 ||u|v|wxy|z|A|s|D||    |l|t|w|xyz|s||
621 |+-+-+-+-+-+B+-+-+|    +-+u+-+-+-+-+|
622 ||E|F|I|JKL|C|M|P||    |A|v|B|E|FGH||
623 |+-+G+-+---+-+N+-+|    +-+-+C+-+-+-+|
624 ||Q|H|R|UVW|X|O|Y||    |IJK|D|L|O|P||
625 |+-+-+S+-+-+-+-+-+|    +-+-+-+M+-+-+|
626 ||Z|0|T|3|456|7|8||    |Q|RST|N|U|V||
627 |+-+1+-+-+-+-+-+-+|    +-+---+-+-+-+|
628 ||9|2|abc|d|efg|h||                 |
629 |+-+-+-+-+-+-+-+-+|                 |
630 ||i|j|k|l|m|n|o|p||                 |
631 |+-+-+-+-+-+-+-+-+|                 |
632 +-----------------+-----------------+
633 |    +-+---+-+-+-+|  +-+---+-+-+-+  |
634 |    |a|bcd|e|f|i||  |a|bcd|e|f|i|  |
635 |    +-+-+-+-+g+-+|  +-+-+-+-+g+-+  |
636 |    |j|m|nop|h|q||  |j|m|nop|h|q|  |
637 |    |k+-+-+-+-+r||  |k+-+-+-+-+r|  |
638 |    |l|t|w|xyz|s||  |l|t|w|xyz|s|  |
639 |    +-+u+-+-+-+-+|  +-+u+-+-+-+-+  |
640 |    |A|v|B|E|FGH||  |A|v|B|E|FGH|  |
641 |    +-+-+C+-+-+-+|  +-+-+C+-+-+-+  |
642 |    |IJK|D|L|O|P||  |IJK|D|L|O|P|  |
643 |    +-+-+-+M+-+-+|  +-+-+-+M+-+-+  |
644 |    |Q|RST|N|U|V||  |Q|RST|N|U|V|  |
645 |    +-+---+-+-+-+|  +-+---+-+-+-+  |
646 +-----------------+-----------------+
647 |  +-+---+-+-+-+  |+-+---+-+-+-+    |
648 |  |a|bcd|e|f|i|  ||a|bcd|e|f|i|    |
649 |  +-+-+-+-+g+-+  |+-+-+-+-+g+-+    |
650 |  |j|m|nop|h|q|  ||j|m|nop|h|q|    |
651 |  |k+-+-+-+-+r|  ||k+-+-+-+-+r|    |
652 |  |l|t|w|xyz|s|  ||l|t|w|xyz|s|    |
653 |  +-+u+-+-+-+-+  |+-+u+-+-+-+-+    |
654 |  |A|v|B|E|FGH|  ||A|v|B|E|FGH|    |
655 |  +-+-+C+-+-+-+  |+-+-+C+-+-+-+    |
656 |  |IJK|D|L|O|P|  ||IJK|D|L|O|P|    |
657 |  +-+-+-+M+-+-+  |+-+-+-+M+-+-+    |
658 |  |Q|RST|N|U|V|  ||Q|RST|N|U|V|    |
659 |  +-+---+-+-+-+  |+-+---+-+-+-+    |
660 +-----------------+-----------------+
661 |+-+---+-+-+-+    |+-+-+-+-+-+-+-+-+|
662 ||a|bcd|e|f|i|    ||a|b|c|d|e|f|g|h||
663 |+-+-+-+-+g+-+    |+-+-+-+-+-+-+-+-+|
664 ||j|m|nop|h|q|    ||i|jkl|m|nop|q|t||
665 ||k+-+-+-+-+r|    |+-+-+-+-+-+-+r+-+|
666 ||l|t|w|xyz|s|    ||u|v|wxy|z|A|s|D||
667 |+-+u+-+-+-+-+    |+-+-+-+-+-+B+-+-+|
668 ||A|v|B|E|FGH|    ||E|F|I|JKL|C|M|P||
669 |+-+-+C+-+-+-+    |+-+G+-+---+-+N+-+|
670 ||IJK|D|L|O|P|    ||Q|H|R|UVW|X|O|Y||
671 |+-+-+-+M+-+-+    |+-+-+S+-+-+-+-+-+|
672 ||Q|RST|N|U|V|    ||Z|0|T|3|456|7|8||
673 |+-+---+-+-+-+    |+-+1+-+-+-+-+-+-+|
674 |                 ||9|2|abc|d|efg|h||
675 |                 |+-+-+-+-+-+-+-+-+|
676 |                 ||i|j|k|l|m|n|o|p||
677 |                 |+-+-+-+-+-+-+-+-+|
678 +-----------------+-----------------+
679 ])
680 AT_CLEANUP
681
682 AT_SETUP([doubly nested cells])
683 AT_KEYWORDS([render rendering])
684 AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl
685 4 2
686 @{0}
687 @{1}
688 @{1}
689 @|{1}
690 @|{1}
691 @({1}
692 @({1}
693 @{0}
694 1 1
695 @{2}
696 ])
697 AT_CHECK([render-test input --length=70], [0], [dnl
698 +-------------------------------------+
699 |+-----------------+-----------------+|
700 ||+-+-+-+-+-+-+-+-+|    +-+---+-+-+-+||
701 |||a|b|c|d|e|f|g|h||    |a|bcd|e|f|i|||
702 ||+-+-+-+-+-+-+-+-+|    +-+-+-+-+g+-+||
703 |||i|jkl|m|nop|q|t||    |j|m|nop|h|q|||
704 ||+-+-+-+-+-+-+r+-+|    |k+-+-+-+-+r|||
705 |||u|v|wxy|z|A|s|D||    |l|t|w|xyz|s|||
706 ||+-+-+-+-+-+B+-+-+|    +-+u+-+-+-+-+||
707 |||E|F|I|JKL|C|M|P||    |A|v|B|E|FGH|||
708 ||+-+G+-+---+-+N+-+|    +-+-+C+-+-+-+||
709 |||Q|H|R|UVW|X|O|Y||    |IJK|D|L|O|P|||
710 ||+-+-+S+-+-+-+-+-+|    +-+-+-+M+-+-+||
711 |||Z|0|T|3|456|7|8||    |Q|RST|N|U|V|||
712 ||+-+1+-+-+-+-+-+-+|    +-+---+-+-+-+||
713 |||9|2|abc|d|efg|h||                 ||
714 ||+-+-+-+-+-+-+-+-+|                 ||
715 |||i|j|k|l|m|n|o|p||                 ||
716 ||+-+-+-+-+-+-+-+-+|                 ||
717 |+-----------------+-----------------+|
718 ||    +-+---+-+-+-+|  +-+---+-+-+-+  ||
719 ||    |a|bcd|e|f|i||  |a|bcd|e|f|i|  ||
720 ||    +-+-+-+-+g+-+|  +-+-+-+-+g+-+  ||
721 ||    |j|m|nop|h|q||  |j|m|nop|h|q|  ||
722 ||    |k+-+-+-+-+r||  |k+-+-+-+-+r|  ||
723 ||    |l|t|w|xyz|s||  |l|t|w|xyz|s|  ||
724 ||    +-+u+-+-+-+-+|  +-+u+-+-+-+-+  ||
725 ||    |A|v|B|E|FGH||  |A|v|B|E|FGH|  ||
726 ||    +-+-+C+-+-+-+|  +-+-+C+-+-+-+  ||
727 ||    |IJK|D|L|O|P||  |IJK|D|L|O|P|  ||
728 ||    +-+-+-+M+-+-+|  +-+-+-+M+-+-+  ||
729 ||    |Q|RST|N|U|V||  |Q|RST|N|U|V|  ||
730 ||    +-+---+-+-+-+|  +-+---+-+-+-+  ||
731 |+-----------------+-----------------+|
732 ||  +-+---+-+-+-+  |+-+---+-+-+-+    ||
733 ||  |a|bcd|e|f|i|  ||a|bcd|e|f|i|    ||
734 ||  +-+-+-+-+g+-+  |+-+-+-+-+g+-+    ||
735 ||  |j|m|nop|h|q|  ||j|m|nop|h|q|    ||
736 ||  |k+-+-+-+-+r|  ||k+-+-+-+-+r|    ||
737 ||  |l|t|w|xyz|s|  ||l|t|w|xyz|s|    ||
738 ||  +-+u+-+-+-+-+  |+-+u+-+-+-+-+    ||
739 ||  |A|v|B|E|FGH|  ||A|v|B|E|FGH|    ||
740 ||  +-+-+C+-+-+-+  |+-+-+C+-+-+-+    ||
741 ||  |IJK|D|L|O|P|  ||IJK|D|L|O|P|    ||
742 ||  +-+-+-+M+-+-+  |+-+-+-+M+-+-+    ||
743 ||  |Q|RST|N|U|V|  ||Q|RST|N|U|V|    ||
744 ||  +-+---+-+-+-+  |+-+---+-+-+-+    ||
745 |+-----------------+-----------------+|
746 ||+-+---+-+-+-+    |+-+-+-+-+-+-+-+-+||
747 |||a|bcd|e|f|i|    ||a|b|c|d|e|f|g|h|||
748 ||+-+-+-+-+g+-+    |+-+-+-+-+-+-+-+-+||
749 |||j|m|nop|h|q|    ||i|jkl|m|nop|q|t|||
750 |||k+-+-+-+-+r|    |+-+-+-+-+-+-+r+-+||
751 |||l|t|w|xyz|s|    ||u|v|wxy|z|A|s|D|||
752 ||+-+u+-+-+-+-+    |+-+-+-+-+-+B+-+-+||
753 |||A|v|B|E|FGH|    ||E|F|I|JKL|C|M|P|||
754 ||+-+-+C+-+-+-+    |+-+G+-+---+-+N+-+||
755 |||IJK|D|L|O|P|    ||Q|H|R|UVW|X|O|Y|||
756 ||+-+-+-+M+-+-+    |+-+-+S+-+-+-+-+-+||
757 |||Q|RST|N|U|V|    ||Z|0|T|3|456|7|8|||
758 ||+-+---+-+-+-+    |+-+1+-+-+-+-+-+-+||
759 ||                 ||9|2|abc|d|efg|h|||
760 ||                 |+-+-+-+-+-+-+-+-+||
761 ||                 ||i|j|k|l|m|n|o|p|||
762 ||                 |+-+-+-+-+-+-+-+-+||
763 |+-----------------+-----------------+|
764 +-------------------------------------+
765 ])
766 AT_CLEANUP
767 \f
768 AT_BANNER([output rendering -- horizontal page breaks])
769
770 AT_SETUP([breaking row of many small cells])
771 AT_KEYWORDS([render rendering])
772 AT_CAPTURE_FILE([input])
773 AT_DATA([input], [1 50
774 m4_for([x], [1], [50], [1], [@x
775 ])])
776 AT_CHECK([render-test input], [0], [dnl
777 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
778 |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|
779 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
780
781 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
782 |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|
783 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
784 ])
785 AT_CHECK([render-test input -o mb0 --min-break=0], [0], [dnl
786 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
787 |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|
788 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
789
790 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
791 |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|
792 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
793 ])
794 AT_CLEANUP
795
796 AT_SETUP([breaking row of many small cells, with headers])
797 AT_KEYWORDS([render rendering])
798 AT_CAPTURE_FILE([input])
799 AT_DATA([input], [1 54 2 2
800 @ha
801 @hb
802 m4_for([x], [1], [50], [1], [@x
803 ])dnl
804 @hc
805 @hd
806 ])
807 AT_CHECK([render-test input], [0], [dnl
808 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
809 |ha|hb|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|hc|hd|
810 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
811
812 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
813 |ha|hb|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|hc|hd|
814 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
815
816 +--+--+--+--+--+--+--+
817 |ha|hb|48|49|50|hc|hd|
818 +--+--+--+--+--+--+--+
819 ])
820 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
821 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
822 |ha|hb|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|hc|hd|
823 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
824
825 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
826 |ha|hb|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|hc|hd|
827 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
828
829 +--+--+--+--+--+--+--+
830 |ha|hb|48|49|50|hc|hd|
831 +--+--+--+--+--+--+--+
832 ])
833 AT_CLEANUP
834
835 AT_SETUP([breaking row of many medium-size cells])
836 AT_KEYWORDS([render rendering])
837 AT_CAPTURE_FILE([input])
838 AT_DATA([input], [1 50
839 m4_for([x], [1], [50], [1], [@cell x
840 ])])
841 AT_CHECK([render-test input], [0], [dnl
842 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
843 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
844 |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  13|  14|  15|
845 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
846
847 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
848 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
849 |  16|  17|  18|  19|  20|  21|  22|  23|  24|  25|  26|  27|  28|  29|  30|
850 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
851
852 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
853 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
854 |  31|  32|  33|  34|  35|  36|  37|  38|  39|  40|  41|  42|  43|  44|  45|
855 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
856
857 +----+----+----+----+----+
858 |cell|cell|cell|cell|cell|
859 |  46|  47|  48|  49|  50|
860 +----+----+----+----+----+
861 ])
862 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
863 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
864 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cel
865 |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  13|  14|  15|  1
866 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
867
868 -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
869 l|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce
870 6|  17|  18|  19|  20|  21|  22|  23|  24|  25|  26|  27|  28|  29|  30|  31|
871 -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
872
873 --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
874 ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|c
875 32|  33|  34|  35|  36|  37|  38|  39|  40|  41|  42|  43|  44|  45|  46|  47|
876 --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
877
878 ---+----+----+
879 ell|cell|cell|
880  48|  49|  50|
881 ---+----+----+
882 ])
883 AT_CLEANUP
884
885 AT_SETUP([breaking row of many medium-size cells, with headers])
886 AT_KEYWORDS([render rendering])
887 AT_CAPTURE_FILE([input])
888 AT_DATA([input], [1 52 1 1
889 header1
890 m4_for([x], [1], [50], [1], [@cell x
891 ])dnl
892 header2
893 ])
894 AT_CHECK([render-test input], [0], [dnl
895        +----+----+----+----+----+----+----+----+----+----+----+----+
896 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
897        |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|
898        +----+----+----+----+----+----+----+----+----+----+----+----+
899
900        +----+----+----+----+----+----+----+----+----+----+----+----+
901 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
902        |  13|  14|  15|  16|  17|  18|  19|  20|  21|  22|  23|  24|
903        +----+----+----+----+----+----+----+----+----+----+----+----+
904
905        +----+----+----+----+----+----+----+----+----+----+----+----+
906 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
907        |  25|  26|  27|  28|  29|  30|  31|  32|  33|  34|  35|  36|
908        +----+----+----+----+----+----+----+----+----+----+----+----+
909
910        +----+----+----+----+----+----+----+----+----+----+----+----+
911 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
912        |  37|  38|  39|  40|  41|  42|  43|  44|  45|  46|  47|  48|
913        +----+----+----+----+----+----+----+----+----+----+----+----+
914
915        +----+----+
916 header1|cell|cell|header2
917        |  49|  50|
918        +----+----+
919 ])
920 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
921        +----+----+----+----+----+----+----+----+----+----+----+----+--+
922 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2
923        |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  |
924        +----+----+----+----+----+----+----+----+----+----+----+----+--+
925
926        +--+----+----+----+----+----+----+----+----+----+----+----+----+
927 header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
928        |13|  14|  15|  16|  17|  18|  19|  20|  21|  22|  23|  24|  25|
929        +--+----+----+----+----+----+----+----+----+----+----+----+----+
930
931        +----+----+----+----+----+----+----+----+----+----+----+----+--+
932 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2
933        |  26|  27|  28|  29|  30|  31|  32|  33|  34|  35|  36|  37|  |
934        +----+----+----+----+----+----+----+----+----+----+----+----+--+
935
936        +--+----+----+----+----+----+----+----+----+----+----+----+----+
937 header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
938        |38|  39|  40|  41|  42|  43|  44|  45|  46|  47|  48|  49|  50|
939        +--+----+----+----+----+----+----+----+----+----+----+----+----+
940 ])
941 AT_CLEANUP
942
943 AT_SETUP([breaking row of many big narrow cells])
944 AT_KEYWORDS([render rendering])
945 AT_CAPTURE_FILE([input])
946 AT_DATA([input], [1 50
947 m4_for([x], [1], [50], [1], [@This is cell x in a series of 50.
948 ])])
949 AT_CHECK([render-test input], [0], [dnl
950 +------+------+------+------+------+------+------+------+------+------+------+
951 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
952 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
953 |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9|  cell|  cell|
954 |  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a| 10 in| 11 in|
955 |series|series|series|series|series|series|series|series|series|     a|     a|
956 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|
957 |      |      |      |      |      |      |      |      |      |of 50.|of 50.|
958 +------+------+------+------+------+------+------+------+------+------+------+
959
960 +------+------+------+------+------+------+------+------+------+------+------+
961 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
962 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
963 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
964 | 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in|
965 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
966 |series|series|series|series|series|series|series|series|series|series|series|
967 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
968 +------+------+------+------+------+------+------+------+------+------+------+
969
970 +------+------+------+------+------+------+------+------+------+------+------+
971 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
972 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
973 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
974 | 23 in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in|
975 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
976 |series|series|series|series|series|series|series|series|series|series|series|
977 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
978 +------+------+------+------+------+------+------+------+------+------+------+
979
980 +------+------+------+------+------+------+------+------+------+------+------+
981 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
982 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
983 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
984 | 34 in| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in|
985 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
986 |series|series|series|series|series|series|series|series|series|series|series|
987 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
988 +------+------+------+------+------+------+------+------+------+------+------+
989
990 +------+------+------+------+------+------+
991 |  This|  This|  This|  This|  This|  This|
992 |    is|    is|    is|    is|    is|    is|
993 |  cell|  cell|  cell|  cell|  cell|  cell|
994 | 45 in| 46 in| 47 in| 48 in| 49 in| 50 in|
995 |     a|     a|     a|     a|     a|     a|
996 |series|series|series|series|series|series|
997 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
998 +------+------+------+------+------+------+
999 ])
1000 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
1001 +------+------+------+------+------+------+------+------+------+------+------+-
1002 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
1003 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
1004 |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9|  cell|  cell|
1005 |  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a| 10 in| 11 in|
1006 |series|series|series|series|series|series|series|series|series|     a|     a|
1007 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|s
1008 |      |      |      |      |      |      |      |      |      |of 50.|of 50.|o
1009 +------+------+------+------+------+------+------+------+------+------+------+-
1010
1011 -----+------+------+------+------+------+------+------+------+------+------+---
1012  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  T
1013    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
1014  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  c
1015 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in| 23
1016     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
1017 eries|series|series|series|series|series|series|series|series|series|series|ser
1018 f 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of
1019 -----+------+------+------+------+------+------+------+------+------+------+---
1020
1021 ---+------+------+------+------+------+------+------+------+------+------+-----
1022 his|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  Thi
1023  is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    i
1024 ell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cel
1025  in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in| 34 i
1026   a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
1027 ies|series|series|series|series|series|series|series|series|series|series|serie
1028 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50
1029 ---+------+------+------+------+------+------+------+------+------+------+-----
1030
1031 -+------+------+------+------+------+------+------+------+------+------+------+
1032 s|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
1033 s|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
1034 l|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
1035 n| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in| 45 in|
1036 a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
1037 s|series|series|series|series|series|series|series|series|series|series|series|
1038 .|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
1039 -+------+------+------+------+------+------+------+------+------+------+------+
1040
1041 +------+------+------+------+------+
1042 |  This|  This|  This|  This|  This|
1043 |    is|    is|    is|    is|    is|
1044 |  cell|  cell|  cell|  cell|  cell|
1045 | 46 in| 47 in| 48 in| 49 in| 50 in|
1046 |     a|     a|     a|     a|     a|
1047 |series|series|series|series|series|
1048 |of 50.|of 50.|of 50.|of 50.|of 50.|
1049 +------+------+------+------+------+
1050 ])
1051 AT_CLEANUP
1052
1053 AT_SETUP([breaking 2 rows of many small cells])
1054 AT_KEYWORDS([render rendering])
1055 AT_CAPTURE_FILE([input])
1056 AT_DATA([input], [2 50
1057 m4_for([x], [1], [100], [1], [@x
1058 ])])
1059 AT_CHECK([render-test input], [0], [dnl
1060 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1061 | 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|
1062 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1063 |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|
1064 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1065
1066 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
1067 |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50|
1068 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
1069 |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|
1070 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
1071 ])
1072 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
1073 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1074 | 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|
1075 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1076 |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|
1077 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1078
1079 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
1080 |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50|
1081 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
1082 |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|
1083 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
1084 ])
1085 AT_CLEANUP
1086
1087 AT_SETUP([breaking 3 rows with many joined cells])
1088 AT_KEYWORDS([render rendering])
1089 AT_CAPTURE_FILE([input])
1090 AT_DATA([input], [3 49
1091 m4_foreach([var], [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,dnl
1092 A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W], [var
1093 ])@1
1094 m4_for([x], [2], [49], [1], [1*2 @x
1095 ])@50
1096 ])
1097 AT_CHECK([render-test input], [0], [dnl
1098  a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M
1099 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1100 |1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20|
1101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1102 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4
1103 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
1104
1105  N O P Q R S T U V  W
1106 +---+---+---+---+----+
1107 | 21| 22| 23| 24|  25|
1108 +-+-+-+-+-+-+-+-+-+--+
1109 45| 46| 47| 48| 49|50|
1110 --+---+---+---+---+--+
1111 ])
1112 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
1113  a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M
1114 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1115 |1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20|
1116 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1117 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4
1118 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
1119
1120  N O P Q R S T U V  W
1121 +---+---+---+---+----+
1122 | 21| 22| 23| 24|  25|
1123 +-+-+-+-+-+-+-+-+-+--+
1124 45| 46| 47| 48| 49|50|
1125 --+---+---+---+---+--+
1126 ])
1127 AT_CLEANUP
1128
1129 AT_SETUP([horz break 6x6, joined rows and columns])
1130 AT_KEYWORDS([render rendering])
1131 AT_DATA([input], [WEAVE_6X6])
1132 AT_DATA([expout], [dnl
1133 +-+--
1134 |a|bc
1135 +-+-+
1136 |j|m|
1137 |k+-+
1138 |l|t|
1139 +-+u|
1140 |A|v|
1141 +-+-+
1142 |IJK|
1143 +-+-+
1144 |Q|RS
1145 +-+--
1146
1147 --+-+
1148 cd|e|
1149 +-+-+
1150 |nop|
1151 +-+-+
1152 |w|xy
1153 +-+-+
1154 |B|E|
1155 |C+-+
1156 |D|L|
1157 +-+M|
1158 ST|N|
1159 --+-+
1160
1161 +-+-+
1162 |f|i|
1163 |g+-+
1164 |h|q|
1165 +-+r|
1166 yz|s|
1167 +-+-+
1168 |FGH|
1169 +-+-+
1170 |O|P|
1171 +-+-+
1172 |U|V|
1173 +-+-+
1174 ])
1175 AT_CHECK([render-test --width=6 input], [0], [expout])
1176 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout])
1177 AT_CLEANUP
1178
1179 AT_SETUP([horz break 6x6, joined rows and columns, left header])
1180 AT_KEYWORDS([render rendering])
1181 AT_DATA([input], [WEAVE_6X6([1 0 0 0])])
1182 AT_DATA([expout], [dnl
1183 +-+---+-+
1184 |a|bcd|e|
1185 +-+-+-+-+
1186 |j|m|nop|
1187 |k+-+-+-+
1188 |l|t|w|xy
1189 +-+u+-+-+
1190 |A|v|B|E|
1191 +-+-+C+-+
1192 |IJK|D|L|
1193 +-+-+-+M|
1194 |Q|RST|N|
1195 +-+---+-+
1196
1197 +-+-+-+
1198 |a|f|i|
1199 +-+g+-+
1200 |j|h|q|
1201 |k+-+r|
1202 |l|z|s|
1203 +-+-+-+
1204 |A|FGH|
1205 +-+-+-+
1206 |K|O|P|
1207 +-+-+-+
1208 |Q|U|V|
1209 +-+-+-+
1210 ])
1211 AT_CHECK([render-test --width=10 input], [0], [expout])
1212 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout])
1213 AT_CLEANUP
1214
1215 AT_SETUP([horz break 6x6, joined rows and columns, right header])
1216 AT_KEYWORDS([render rendering])
1217 AT_DATA([input], [WEAVE_6X6([0 1 0 0])])
1218 AT_DATA([expout], [dnl
1219 +-+---+-+
1220 |a|bcd|i|
1221 +-+-+-+-+
1222 |j|m|n|q|
1223 |k+-+-+r|
1224 |l|t|w|s|
1225 +-+u+-+-+
1226 |A|v|B|H|
1227 +-+-+C+-+
1228 |IJK|D|P|
1229 +-+-+-+-+
1230 |Q|RST|V|
1231 +-+---+-+
1232
1233 +-+-+-+
1234 |e|f|i|
1235 +-+g+-+
1236 op|h|q|
1237 +-+-+r|
1238 |xyz|s|
1239 +-+-+-+
1240 |E|FGH|
1241 +-+-+-+
1242 |L|O|P|
1243 |M+-+-+
1244 |N|U|V|
1245 +-+-+-+
1246 ])
1247 AT_CHECK([render-test --width=10 input], [0], [expout])
1248 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout])
1249 AT_CLEANUP
1250
1251 AT_SETUP([breaking joined cells too wide for page])
1252 AT_KEYWORDS([render rendering])
1253 AT_DATA([input], [4 6
1254 1*6 @abc def ghi jkl
1255 1*3 @mno pqr
1256 1*3 @stu vwx
1257 1*2 @yzA
1258 1*2 @BCD
1259 1*2 @EFG
1260 @H
1261 @I
1262 @J
1263 @K
1264 @L
1265 @M
1266 ])
1267 AT_CHECK([render-test --width=10 input], [0], [dnl
1268 +--------
1269 |abc def
1270 |
1271 +-----+--
1272 |  mno|
1273 |  pqr|
1274 +---+-+-+
1275 |yzA|BCD|
1276 +-+-+-+-+
1277 |H|I|J|K|
1278 +-+-+-+-+
1279
1280 ----+
1281  ghi|
1282  jkl|
1283 ----+
1284  stu|
1285  vwx|
1286 +---+
1287 |EFG|
1288 +-+-+
1289 |L|M|
1290 +-+-+
1291 ])
1292 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [dnl
1293 +--------
1294 |abc def
1295 |
1296 +-----+--
1297 |  mno|
1298 |  pqr|
1299 +---+-+-+
1300 |yzA|BCD|
1301 +-+-+-+-+
1302 |H|I|J|K|
1303 +-+-+-+-+
1304
1305 ----+
1306  ghi|
1307  jkl|
1308 ----+
1309  stu|
1310  vwx|
1311 +---+
1312 |EFG|
1313 +-+-+
1314 |L|M|
1315 +-+-+
1316 ])
1317 AT_CLEANUP
1318
1319 AT_SETUP([breaking joined cells much too wide for page])
1320 AT_KEYWORDS([render rendering])
1321 AT_DATA([input], [4 6
1322 1*6 @abc def ghi jkl
1323 1*3 @mno pqr
1324 1*3 @stu vwx
1325 1*2 @yzA
1326 1*2 @BCD
1327 1*2 @EFG
1328 @H
1329 @I
1330 @J
1331 @K
1332 @L
1333 @M
1334 ])
1335 AT_CHECK([render-test --width=6 input], [0], [dnl
1336 +----
1337 |abc
1338 |
1339 +----
1340 |  mn
1341 |  pq
1342 +---+
1343 |yzA|
1344 +-+-+
1345 |H|I|
1346 +-+-+
1347
1348 -----
1349  def
1350
1351 --+--
1352 no|
1353 qr|
1354 +-+-+
1355 |BCD|
1356 +-+-+
1357 |J|K|
1358 +-+-+
1359
1360 ----+
1361  ghi|
1362  jkl|
1363 ----+
1364  stu|
1365  vwx|
1366 +---+
1367 |EFG|
1368 +-+-+
1369 |L|M|
1370 +-+-+
1371 ])
1372 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl
1373 +----
1374 |abc
1375 |
1376 +----
1377 |  mn
1378 |  pq
1379 +---+
1380 |yzA|
1381 +-+-+
1382 |H|I|
1383 +-+-+
1384
1385 -----
1386  def
1387
1388 --+--
1389 no|
1390 qr|
1391 +-+-+
1392 |BCD|
1393 +-+-+
1394 |J|K|
1395 +-+-+
1396
1397 ----+
1398  ghi|
1399  jkl|
1400 ----+
1401  stu|
1402  vwx|
1403 +---+
1404 |EFG|
1405 +-+-+
1406 |L|M|
1407 +-+-+
1408 ])
1409 AT_CLEANUP
1410
1411 AT_SETUP([breaking cell too wide for page, no border])
1412 AT_KEYWORDS([render rendering])
1413 AT_CAPTURE_FILE([input])
1414 AT_DATA([input], [1 1
1415 abcdefghijklmnopqrstuvwxyz
1416 ])
1417 AT_CHECK([render-test --width=6 input], [0], [dnl
1418 abcdef
1419
1420 ghijkl
1421
1422 mnopqr
1423
1424 stuvwx
1425
1426 yz
1427 ])
1428 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl
1429 abcdef
1430
1431 ghijkl
1432
1433 mnopqr
1434
1435 stuvwx
1436
1437 yz
1438 ])
1439 AT_CLEANUP
1440
1441 AT_SETUP([breaking cell too wide for page, with border])
1442 AT_KEYWORDS([render rendering])
1443 AT_CAPTURE_FILE([input])
1444 AT_DATA([input], [1 1
1445 @abcdefghijklmnopqrstuvwxyz
1446 ])
1447 AT_DATA([expout], [dnl
1448 +-----
1449 |abcde
1450 +-----
1451
1452 ------
1453 fghijk
1454 ------
1455
1456 ------
1457 lmnopq
1458 ------
1459
1460 ------
1461 rstuvw
1462 ------
1463
1464 ---+
1465 xyz|
1466 ---+
1467 ])
1468 AT_CHECK([render-test --width=6 input], [0], [expout])
1469 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout])
1470 AT_CLEANUP
1471
1472 AT_SETUP([horz break 8x8 with many 2x2 joins])
1473 AT_KEYWORDS([render rendering])
1474 AT_DATA([input], [WEAVE_8X8_2])
1475 AT_CHECK([render-test --width=8 input], [0],[dnl
1476 +---+--
1477 |abc|jk
1478 |def|  
1479 |ghi+--
1480 |   |yz
1481 +-+-+BC
1482 |Q|V|EF
1483 |R| |  
1484 |S+-+-+
1485 |T|012|
1486 |U|345|
1487 | |678|
1488 | |   |
1489 +-+-+-+
1490 |xyz|G|
1491 |ABC|H|
1492 |DEF|I|
1493 |   | |
1494 +---+-+
1495 |abcde|
1496 |     |
1497 +-----+
1498
1499 --+----+
1500 kl| mno|
1501   | pqr|
1502 --+ stu|
1503 zA|    |
1504 CD+-+--+
1505 FG|W| Z|
1506   |X|  |
1507 +-+Y+--+
1508 |9| | ab
1509 | | | de
1510 +-+-+ gh
1511 |opq|   
1512 |rst+---
1513 |uvw| JK
1514 |   |   
1515 +---+--+
1516 | MNOPQ|
1517 | RSTUV|
1518 | WXYZ0|
1519 |      |
1520 +------+
1521
1522 +----+
1523 | vwx|
1524 |    |
1525 +----+
1526 | HIJ|
1527 | KLM|
1528 | NOP|
1529 |    |
1530 +-+--+
1531 bc| j|
1532 ef| k|
1533 hi| l|
1534   | m|
1535 --+ n|
1536 KL|  |
1537   |  |
1538 +-+--+
1539 | 123|
1540 | 456|
1541
1542 | 456|
1543 | 789|
1544 |    |
1545 +----+
1546 ])
1547 AT_CHECK([render-test -o mb0 --min-break=0 --width=8 input], [0],[dnl
1548 +---+--
1549 |abc|jk
1550 |def|  
1551 |ghi+--
1552 |   |yz
1553 +-+-+BC
1554 |Q|V|EF
1555 |R| |  
1556 |S+-+-+
1557 |T|012|
1558 |U|345|
1559 | |678|
1560 | |   |
1561 +-+-+-+
1562 |xyz|G|
1563 |ABC|H|
1564 |DEF|I|
1565 |   | |
1566 +---+-+
1567 |abcde|
1568 |     |
1569 +-----+
1570
1571 --+----+
1572 kl| mno|
1573   | pqr|
1574 --+ stu|
1575 zA|    |
1576 CD+-+--+
1577 FG|W| Z|
1578   |X|  |
1579 +-+Y+--+
1580 |9| | ab
1581 | | | de
1582 +-+-+ gh
1583 |opq|   
1584 |rst+---
1585 |uvw| JK
1586 |   |   
1587 +---+--+
1588 | MNOPQ|
1589 | RSTUV|
1590 | WXYZ0|
1591 |      |
1592 +------+
1593
1594 +----+
1595 | vwx|
1596 |    |
1597 +----+
1598 | HIJ|
1599 | KLM|
1600 | NOP|
1601 |    |
1602 +-+--+
1603 bc| j|
1604 ef| k|
1605 hi| l|
1606   | m|
1607 --+ n|
1608 KL|  |
1609   |  |
1610 +-+--+
1611 | 123|
1612 | 456|
1613 | 789|
1614
1615 |    |
1616 +----+
1617 ])
1618 AT_CLEANUP
1619 \f
1620 AT_BANNER([output rendering -- vertical page breaks])
1621
1622 AT_SETUP([breaking column of many small cells])
1623 AT_KEYWORDS([render rendering])
1624 AT_CAPTURE_FILE([input])
1625 AT_DATA([input], [20 1
1626 m4_for([x], [1], [20], [1], [@x
1627 ])])
1628 AT_CHECK([render-test --length=10 input], [0], [dnl
1629 +--+
1630 | 1|
1631 +--+
1632 | 2|
1633 +--+
1634 | 3|
1635 +--+
1636 | 4|
1637 +--+
1638
1639 +--+
1640 | 5|
1641 +--+
1642 | 6|
1643 +--+
1644 | 7|
1645 +--+
1646 | 8|
1647 +--+
1648
1649 +--+
1650 | 9|
1651 +--+
1652 |10|
1653 +--+
1654 |11|
1655 +--+
1656 |12|
1657 +--+
1658
1659 +--+
1660 |13|
1661 +--+
1662 |14|
1663 +--+
1664 |15|
1665 +--+
1666 |16|
1667 +--+
1668
1669 +--+
1670 |17|
1671 +--+
1672 |18|
1673 +--+
1674 |19|
1675 +--+
1676 |20|
1677 +--+
1678 ])
1679 AT_CHECK([render-test -o mb0 --min-break=0 --length=10 input], [0], [dnl
1680 +--+
1681 | 1|
1682 +--+
1683 | 2|
1684 +--+
1685 | 3|
1686 +--+
1687 | 4|
1688 +--+
1689
1690 +--+
1691 | 5|
1692 +--+
1693 | 6|
1694 +--+
1695 | 7|
1696 +--+
1697 | 8|
1698 +--+
1699
1700 +--+
1701 | 9|
1702 +--+
1703 |10|
1704 +--+
1705 |11|
1706 +--+
1707 |12|
1708 +--+
1709
1710 +--+
1711 |13|
1712 +--+
1713 |14|
1714 +--+
1715 |15|
1716 +--+
1717 |16|
1718 +--+
1719
1720 +--+
1721 |17|
1722 +--+
1723 |18|
1724 +--+
1725 |19|
1726 +--+
1727 |20|
1728 +--+
1729 ])
1730 AT_CLEANUP
1731
1732 AT_SETUP([breaking column of many small cells, with headers])
1733 AT_KEYWORDS([render rendering])
1734 AT_CAPTURE_FILE([input])
1735 AT_DATA([input], [17 1 0 0 1 1
1736 @a
1737 m4_for([x], [1], [15], [1], [@x
1738 ])@b
1739 ])
1740 AT_CHECK([render-test --length=13 input], [0], [dnl
1741 +--+
1742 | a|
1743 +--+
1744 | 1|
1745 +--+
1746 | 2|
1747 +--+
1748 | 3|
1749 +--+
1750 | 4|
1751 +--+
1752 | b|
1753 +--+
1754
1755 +--+
1756 | a|
1757 +--+
1758 | 5|
1759 +--+
1760 | 6|
1761 +--+
1762 | 7|
1763 +--+
1764 | 8|
1765 +--+
1766 | b|
1767 +--+
1768
1769 +--+
1770 | a|
1771 +--+
1772 | 9|
1773 +--+
1774 |10|
1775 +--+
1776 |11|
1777 +--+
1778 |12|
1779 +--+
1780 | b|
1781 +--+
1782
1783 +--+
1784 | a|
1785 +--+
1786 |13|
1787 +--+
1788 |14|
1789 +--+
1790 |15|
1791 +--+
1792 | b|
1793 +--+
1794 ])
1795 AT_CHECK([render-test -o mb0 --min-break=0 --length=13 input], [0], [dnl
1796 +--+
1797 | a|
1798 +--+
1799 | 1|
1800 +--+
1801 | 2|
1802 +--+
1803 | 3|
1804 +--+
1805 | 4|
1806 +--+
1807 | b|
1808 +--+
1809
1810 +--+
1811 | a|
1812 +--+
1813 | 5|
1814 +--+
1815 | 6|
1816 +--+
1817 | 7|
1818 +--+
1819 | 8|
1820 +--+
1821 | b|
1822 +--+
1823
1824 +--+
1825 | a|
1826 +--+
1827 | 9|
1828 +--+
1829 |10|
1830 +--+
1831 |11|
1832 +--+
1833 |12|
1834 +--+
1835 | b|
1836 +--+
1837
1838 +--+
1839 | a|
1840 +--+
1841 |13|
1842 +--+
1843 |14|
1844 +--+
1845 |15|
1846 +--+
1847 | b|
1848 +--+
1849 ])
1850 AT_CLEANUP
1851
1852 AT_SETUP([disabling too-big headers])
1853 AT_KEYWORDS([render rendering])
1854 AT_CAPTURE_FILE([input])
1855 AT_DATA([input], [17 1 0 0 1 1
1856 @a
1857 m4_for([x], [1], [15], [1], [@x
1858 ])@b
1859 ])
1860 AT_DATA([expout], [dnl
1861 +--+
1862 | a|
1863 +--+
1864 | 1|
1865 +--+
1866 | 2|
1867 +--+
1868 | 3|
1869 +--+
1870
1871 +--+
1872 | 4|
1873 +--+
1874 | 5|
1875 +--+
1876 | 6|
1877 +--+
1878 | 7|
1879 +--+
1880
1881 +--+
1882 | 8|
1883 +--+
1884 | 9|
1885 +--+
1886 |10|
1887 +--+
1888 |11|
1889 +--+
1890
1891 +--+
1892 |12|
1893 +--+
1894 |13|
1895 +--+
1896 |14|
1897 +--+
1898 |15|
1899 +--+
1900
1901 +--+
1902 | b|
1903 +--+
1904 ])
1905 AT_CHECK([render-test --length=10 input], [0], [expout])
1906 AT_CHECK([render-test -o mb0 --min-break=0 --length=10 input], [0], [expout])
1907 AT_CLEANUP
1908
1909 AT_SETUP([breaking column of many medium-size cells])
1910 AT_KEYWORDS([render rendering])
1911 AT_CAPTURE_FILE([input])
1912 AT_DATA([input], [20 1
1913 m4_for([x], [1], [20], [1], [@top x\ncell x\nbottom x
1914 ])])
1915 AT_CHECK([render-test --length 10 input], [0], [dnl
1916 +---------+
1917 |    top 1|
1918 |   cell 1|
1919 | bottom 1|
1920 +---------+
1921 |    top 2|
1922 |   cell 2|
1923 | bottom 2|
1924 +---------+
1925
1926 +---------+
1927 |    top 3|
1928 |   cell 3|
1929 | bottom 3|
1930 +---------+
1931 |    top 4|
1932 |   cell 4|
1933 | bottom 4|
1934 +---------+
1935
1936 +---------+
1937 |    top 5|
1938 |   cell 5|
1939 | bottom 5|
1940 +---------+
1941 |    top 6|
1942 |   cell 6|
1943 | bottom 6|
1944 +---------+
1945
1946 +---------+
1947 |    top 7|
1948 |   cell 7|
1949 | bottom 7|
1950 +---------+
1951 |    top 8|
1952 |   cell 8|
1953 | bottom 8|
1954 +---------+
1955
1956 +---------+
1957 |    top 9|
1958 |   cell 9|
1959 | bottom 9|
1960 +---------+
1961 |   top 10|
1962 |  cell 10|
1963 |bottom 10|
1964 +---------+
1965
1966 +---------+
1967 |   top 11|
1968 |  cell 11|
1969 |bottom 11|
1970 +---------+
1971 |   top 12|
1972 |  cell 12|
1973 |bottom 12|
1974 +---------+
1975
1976 +---------+
1977 |   top 13|
1978 |  cell 13|
1979 |bottom 13|
1980 +---------+
1981 |   top 14|
1982 |  cell 14|
1983 |bottom 14|
1984 +---------+
1985
1986 +---------+
1987 |   top 15|
1988 |  cell 15|
1989 |bottom 15|
1990 +---------+
1991 |   top 16|
1992 |  cell 16|
1993 |bottom 16|
1994 +---------+
1995
1996 +---------+
1997 |   top 17|
1998 |  cell 17|
1999 |bottom 17|
2000 +---------+
2001 |   top 18|
2002 |  cell 18|
2003 |bottom 18|
2004 +---------+
2005
2006 +---------+
2007 |   top 19|
2008 |  cell 19|
2009 |bottom 19|
2010 +---------+
2011 |   top 20|
2012 |  cell 20|
2013 |bottom 20|
2014 +---------+
2015 ])
2016 AT_CHECK([render-test -o mb0 --min-break=0 --length 10 input], [0], [dnl
2017 +---------+
2018 |    top 1|
2019 |   cell 1|
2020 | bottom 1|
2021 +---------+
2022 |    top 2|
2023 |   cell 2|
2024 | bottom 2|
2025 +---------+
2026 |    top 3|
2027
2028 |   cell 3|
2029 | bottom 3|
2030 +---------+
2031 |    top 4|
2032 |   cell 4|
2033 | bottom 4|
2034 +---------+
2035 |    top 5|
2036 |   cell 5|
2037
2038 | bottom 5|
2039 +---------+
2040 |    top 6|
2041 |   cell 6|
2042 | bottom 6|
2043 +---------+
2044 |    top 7|
2045 |   cell 7|
2046 | bottom 7|
2047 +---------+
2048
2049 +---------+
2050 |    top 8|
2051 |   cell 8|
2052 | bottom 8|
2053 +---------+
2054 |    top 9|
2055 |   cell 9|
2056 | bottom 9|
2057 +---------+
2058 |   top 10|
2059
2060 |  cell 10|
2061 |bottom 10|
2062 +---------+
2063 |   top 11|
2064 |  cell 11|
2065 |bottom 11|
2066 +---------+
2067 |   top 12|
2068 |  cell 12|
2069
2070 |bottom 12|
2071 +---------+
2072 |   top 13|
2073 |  cell 13|
2074 |bottom 13|
2075 +---------+
2076 |   top 14|
2077 |  cell 14|
2078 |bottom 14|
2079 +---------+
2080
2081 +---------+
2082 |   top 15|
2083 |  cell 15|
2084 |bottom 15|
2085 +---------+
2086 |   top 16|
2087 |  cell 16|
2088 |bottom 16|
2089 +---------+
2090 |   top 17|
2091
2092 |  cell 17|
2093 |bottom 17|
2094 +---------+
2095 |   top 18|
2096 |  cell 18|
2097 |bottom 18|
2098 +---------+
2099 |   top 19|
2100 |  cell 19|
2101
2102 |bottom 19|
2103 +---------+
2104 |   top 20|
2105 |  cell 20|
2106 |bottom 20|
2107 +---------+
2108 ])
2109 AT_CLEANUP
2110
2111 AT_SETUP([breaking 3 columns with many joined cells])
2112 AT_KEYWORDS([render rendering])
2113 AT_CAPTURE_FILE([input])
2114 #  +--+--+
2115 # a| 1|11|
2116 #  +--+ab|
2117 # b| 2|cd|
2118 #  |ab+--+
2119 # c|cd|12|
2120 #  +--+ab|
2121 # d| 3|cd|
2122 #  |ab+--+
2123 # e|cd|13|
2124 #  +--+ab|
2125 # f| 4|cd|
2126 #  |ab+--+
2127 # g|cd|14|
2128 #  +--+ab|
2129 # h| 5|cd|
2130 #  |ab+--+
2131 # i|cd|15|
2132 #  +--+ab|
2133 # j| 6|cd|
2134 #  |ab+--+
2135 # k|cd|16|
2136 #  +--+ab|
2137 # l| 7|cd|
2138 #  |ab+--+
2139 # m|cd|17|
2140 #  +--+ab|
2141 # n| 8|cd|
2142 #  |ab+--+
2143 # o|cd|18|
2144 #  +--+ab|
2145 # p| 9|cd|
2146 #  |ab+--+
2147 # q|cd|19|
2148 #  +--+ab|
2149 # r|10|cd|
2150 #  |ab+--+
2151 # s|cd|20|
2152 #  +--+--+
2153 AT_DATA([input], [3 19
2154 m4_foreach([x], [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s], [x
2155 ])@1
2156 m4_for([x], [2], [19], [1], [1*2 @x\nab\ncd
2157 ])@20
2158 ])
2159 AT_DATA([expout], [dnl
2160  +--+--+
2161 a| 1|11|
2162  +--+ab|
2163 b| 2|cd|
2164  |ab+--+
2165
2166  |ab+--+
2167 c|cd|12|
2168  +--+ab|
2169 d| 3|cd|
2170  |ab+--+
2171
2172  |ab+--+
2173 e|cd|13|
2174  +--+ab|
2175 f| 4|cd|
2176  |ab+--+
2177
2178  |ab+--+
2179 g|cd|14|
2180  +--+ab|
2181 h| 5|cd|
2182  |ab+--+
2183
2184  |ab+--+
2185 i|cd|15|
2186  +--+ab|
2187 j| 6|cd|
2188  |ab+--+
2189
2190  |ab+--+
2191 k|cd|16|
2192  +--+ab|
2193 l| 7|cd|
2194  |ab+--+
2195
2196  |ab+--+
2197 m|cd|17|
2198  +--+ab|
2199 n| 8|cd|
2200  |ab+--+
2201
2202  |ab+--+
2203 o|cd|18|
2204  +--+ab|
2205 p| 9|cd|
2206  |ab+--+
2207
2208  |ab+--+
2209 q|cd|19|
2210  +--+ab|
2211 r|10|cd|
2212  |ab+--+
2213
2214  |ab+--+
2215 s|cd|20|
2216  +--+--+
2217 ])
2218 AT_CHECK([render-test --length=6 --transpose input], [0], [expout])
2219 AT_CHECK([render-test -o mb0 --min-break=0 --length=6 --transpose input],
2220   [0], [expout])
2221 AT_CLEANUP
2222
2223 AT_SETUP([vert break 6x6, joined rows and columns])
2224 AT_KEYWORDS([render rendering])
2225 AT_DATA([input], [WEAVE_6X6])
2226 AT_CHECK([render-test --length=6 input], [0], [dnl
2227 +-+---+-+-+-+
2228 |a|bcd|e|f|i|
2229 +-+-+-+-+g+-+
2230 |j|m|nop|h|q|
2231 |k+-+---+-+r|
2232
2233 |k+-+-+---+r|
2234 |l|t|w|xyz|s|
2235 +-+u+-+-+-+-+
2236 |A|v|B|E|FGH|
2237 +-+-+C+-+---+
2238
2239 +---+C+-+-+-+
2240 |IJK|D|L|O|P|
2241 +-+-+-+M+-+-+
2242 |Q|RST|N|U|V|
2243 +-+---+-+-+-+
2244 ])
2245 AT_CHECK([render-test -o mb0 --min-break=0 --length=6 input], [0], [dnl
2246 +-+---+-+-+-+
2247 |a|bcd|e|f|i|
2248 +-+-+-+-+g+-+
2249 |j|m|nop|h|q|
2250 |k+-+---+-+r|
2251
2252 |k+-+-+---+r|
2253 |l|t|w|xyz|s|
2254 +-+u+-+-+-+-+
2255 |A|v|B|E|FGH|
2256 +-+-+C+-+---+
2257
2258 +---+C+-+-+-+
2259 |IJK|D|L|O|P|
2260 +-+-+-+M+-+-+
2261 |Q|RST|N|U|V|
2262 +-+---+-+-+-+
2263 ])
2264 AT_CLEANUP
2265
2266 AT_SETUP([breaking joined cells too tall for page])
2267 AT_KEYWORDS([render rendering])
2268 AT_DATA([input], [4 6
2269 1*6 @abc\ndef\nghi\njkl\nmno\npqr\nstu\nvwx\nyzA\nBCD\nEFG
2270 1*3 @HIJ\nKLM\nOPQ\nRST\nUVW
2271 1*3 @XYZ\n012\n345\n678\n90a
2272 1*2 @bcd\nefg\nhij
2273 1*2 @klm\nnop\nqrs
2274 1*2 @tuv\nwxy\nzAB
2275 @C
2276 @D
2277 @E
2278 @F
2279 @G
2280 @H
2281 ])
2282 AT_CHECK([render-test --transpose --length=6 input], [0], [dnl
2283 +---+---+---+-+
2284 |abc|HIJ|bcd|C|
2285 |def|KLM|efg+-+
2286 |ghi|OPQ|hij|D|
2287 |jkl|RST+---+-+
2288
2289 |jkl|RST+---+-+
2290 |mno|UVW|klm|E|
2291 |pqr+---+nop+-+
2292 |stu|XYZ|qrs|F|
2293 |vwx|012+---+-+
2294
2295 |vwx|012+---+-+
2296 |yzA|345|tuv|G|
2297 |BCD|678|wxy+-+
2298 |EFG|90a|zAB|H|
2299 +---+---+---+-+
2300 ])
2301 AT_CHECK([render-test -o mb0 --min-break=0 --transpose --length=6 input], [0], [dnl
2302 +---+---+---+-+
2303 |abc|HIJ|bcd|C|
2304 |def|KLM|efg+-+
2305 |ghi|OPQ|hij|D|
2306 |jkl|RST+---+-+
2307
2308 |jkl|RST+---+-+
2309 |mno|UVW|klm|E|
2310 |pqr+---+nop+-+
2311 |stu|XYZ|qrs|F|
2312 |vwx|012+---+-+
2313
2314 |vwx|012+---+-+
2315 |yzA|345|tuv|G|
2316 |BCD|678|wxy+-+
2317 |EFG|90a|zAB|H|
2318 +---+---+---+-+
2319 ])
2320 AT_CLEANUP
2321
2322 AT_SETUP([breaking cell too tall for page, no border])
2323 AT_KEYWORDS([render rendering])
2324 AT_CAPTURE_FILE([input])
2325 AT_DATA([input], [1 1
2326 abc defg hij klmn opq rstu vwx yz ABCDE FGH I JK LMNOP QR STU VWXYZ
2327 ])
2328 AT_CHECK([render-test --width=6 --length=6 input], [0], [dnl
2329    abc
2330   defg
2331    hij
2332   klmn
2333    opq
2334   rstu
2335
2336 vwx yz
2337  ABCDE
2338  FGH I
2339     JK
2340  LMNOP
2341 QR STU
2342
2343  VWXYZ
2344 ])
2345 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 --length=6 input], [0], [dnl
2346    abc
2347   defg
2348    hij
2349   klmn
2350    opq
2351   rstu
2352
2353 vwx yz
2354  ABCDE
2355  FGH I
2356     JK
2357  LMNOP
2358 QR STU
2359
2360  VWXYZ
2361 ])
2362 AT_CLEANUP
2363
2364 AT_SETUP([breaking cell too tall for page, with border])
2365 AT_KEYWORDS([render rendering])
2366 AT_CAPTURE_FILE([input])
2367 AT_DATA([input], [1 1
2368 @abc defg hij klmn opq rstu vwx yz ABCDE FGH I JK LMNOP QR STU VWXYZ
2369 ])
2370 AT_DATA([expout], [dnl
2371 +-----+
2372 |  abc|
2373 | defg|
2374 |  hij|
2375 | klmn|
2376 |  opq|
2377
2378 | rstu|
2379 |  vwx|
2380 |   yz|
2381 |ABCDE|
2382 |FGH I|
2383 |   JK|
2384
2385 |LMNOP|
2386 |   QR|
2387 |  STU|
2388 |VWXYZ|
2389 +-----+
2390 ])
2391 AT_CHECK([render-test --width=7 --length=6 input], [0], [expout])
2392 AT_CHECK([render-test -o mb0 --min-break=0 --width=7 --length=6 input],
2393   [0], [expout])
2394 AT_CLEANUP
2395
2396 AT_SETUP([breaking nested cell too tall for page])
2397 AT_KEYWORDS([render rendering])
2398 AT_CAPTURE_FILE([input])
2399 AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl
2400 1 2
2401 @{0}
2402 @{1}
2403 ])
2404 AT_CHECK([render-test input --length=10], [0], [dnl
2405 +-----------------+-------------+
2406 |+-+-+-+-+-+-+-+-+|+-+---+-+-+-+|
2407 ||a|b|c|d|e|f|g|h|||a|bcd|e|f|i||
2408 |+-+-+-+-+-+-+-+-+|+-+-+-+-+g+-+|
2409 ||i|jkl|m|nop|q|t|||j|m|nop|h|q||
2410 |+-+-+-+-+-+-+r+-+||k+-+-+-+-+r||
2411 ||u|v|wxy|z|A|s|D|||l|t|w|xyz|s||
2412 |+-+-+-+-+-+B+-+-+|+-+u+-+-+-+-+|
2413 ||E|F|I|JKL|C|M|P|||A|v|B|E|FGH||
2414 |+-+G+-+---+-+N+-+|+-+-+C+-+-+-+|
2415
2416 ||Q|H|R|UVW|X|O|Y|||IJK|D|L|O|P||
2417 |+-+-+S+-+-+-+-+-+|+-+-+-+M+-+-+|
2418 ||Z|0|T|3|456|7|8|||Q|RST|N|U|V||
2419 |+-+1+-+-+-+-+-+-+|+-+---+-+-+-+|
2420 ||9|2|abc|d|efg|h||             |
2421 |+-+-+-+-+-+-+-+-+|             |
2422 ||i|j|k|l|m|n|o|p||             |
2423 |+-+-+-+-+-+-+-+-+|             |
2424 +-----------------+-------------+
2425 ])
2426 AT_CLEANUP
2427 \f
2428 AT_BANNER([output rendering -- double page breaks])
2429
2430 AT_SETUP([double break 6x6, joined rows and columns])
2431 AT_KEYWORDS([render rendering])
2432 AT_DATA([input], [WEAVE_6X6])
2433 AT_CHECK([render-test --width=6 --length=6 input], [0], [dnl
2434 +-+--
2435 |a|bc
2436 +-+-+
2437 |j|m|
2438 |k+-+
2439
2440 |k+-+
2441 |l|t|
2442 +-+u|
2443 |A|v|
2444 +-+-+
2445
2446 +---+
2447 |IJK|
2448 +-+-+
2449 |Q|RS
2450 +-+--
2451
2452 --+-+
2453 cd|e|
2454 +-+-+
2455 |nop|
2456 +---+
2457
2458 +-+--
2459 |w|xy
2460 +-+-+
2461 |B|E|
2462 |C+-+
2463
2464 |C+-+
2465 |D|L|
2466 +-+M|
2467 ST|N|
2468 --+-+
2469
2470 +-+-+
2471 |f|i|
2472 |g+-+
2473 |h|q|
2474 +-+r|
2475
2476 --+r|
2477 yz|s|
2478 +-+-+
2479 |FGH|
2480 +---+
2481
2482 +-+-+
2483 |O|P|
2484 +-+-+
2485 |U|V|
2486 +-+-+
2487 ])
2488 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 --length=6 input], [0], [dnl
2489 +-+--
2490 |a|bc
2491 +-+-+
2492 |j|m|
2493 |k+-+
2494
2495 |k+-+
2496 |l|t|
2497 +-+u|
2498 |A|v|
2499 +-+-+
2500
2501 +---+
2502 |IJK|
2503 +-+-+
2504 |Q|RS
2505 +-+--
2506
2507 --+-+
2508 cd|e|
2509 +-+-+
2510 |nop|
2511 +---+
2512
2513 +-+--
2514 |w|xy
2515 +-+-+
2516 |B|E|
2517 |C+-+
2518
2519 |C+-+
2520 |D|L|
2521 +-+M|
2522 ST|N|
2523 --+-+
2524
2525 +-+-+
2526 |f|i|
2527 |g+-+
2528 |h|q|
2529 +-+r|
2530
2531 --+r|
2532 yz|s|
2533 +-+-+
2534 |FGH|
2535 +---+
2536
2537 +-+-+
2538 |O|P|
2539 +-+-+
2540 |U|V|
2541 +-+-+
2542 ])
2543 AT_CLEANUP
2544
2545 AT_SETUP([double break 8x8, with joins, left and right headers])
2546 AT_KEYWORDS([render rendering])
2547 AT_DATA([input], [WEAVE_8X8([1 1 0 0])])
2548 AT_CHECK([render-test input --width=14 --length=14], [0], [dnl
2549 +-+-+-+-+-+-+
2550 |a|b|c|d|e|h|
2551 +-+-+-+-+-+-+
2552 |i|jkl|m|n|t|
2553 +-+-+-+-+-+-+
2554 |u|v|wxy|z|D|
2555 +-+-+-+-+-+-+
2556 |E|F|I|JKL|P|
2557 +-+G+-+---+-+
2558 |Q|H|R|UVW|Y|
2559 +-+-+S+-+-+-+
2560 |Z|0|T|3|4|8|
2561 +-+1+-+-+-+-+
2562
2563 +-+1+---+-+-+
2564 |9|2|abc|d|h|
2565 +-+-+-+-+-+-+
2566 |i|j|k|l|m|p|
2567 +-+-+-+-+-+-+
2568
2569 +-+--+-+-+
2570 |a| f|g|h|
2571 +-+--+-+-+
2572 |i|op|q|t|
2573 +-+--+r+-+
2574 |u| A|s|D|
2575 +-+ B+-+-+
2576
2577 +-+ B+-+-+
2578 |E| C|M|P|
2579 +-+--+N+-+
2580 |Q| X|O|Y|
2581 +-+--+-+-+
2582 |Z|56|7|8|
2583 +-+--+-+-+
2584 |9| efg|h|
2585 +-+--+-+-+
2586 |i| n|o|p|
2587 +-+--+-+-+
2588 ])
2589 AT_CHECK([render-test -o mb0 --min-break=0 input --width=14 --length=14], [0], [dnl
2590 +-+-+-+-+-+-+
2591 |a|b|c|d|e|h|
2592 +-+-+-+-+-+-+
2593 |i|jkl|m|n|t|
2594 +-+-+-+-+-+-+
2595 |u|v|wxy|z|D|
2596 +-+-+-+-+-+-+
2597 |E|F|I|JKL|P|
2598 +-+G+-+---+-+
2599 |Q|H|R|UVW|Y|
2600 +-+-+S+-+-+-+
2601 |Z|0|T|3|4|8|
2602 +-+1+-+-+-+-+
2603
2604 +-+1+---+-+-+
2605 |9|2|abc|d|h|
2606 +-+-+-+-+-+-+
2607 |i|j|k|l|m|p|
2608 +-+-+-+-+-+-+
2609
2610 +-+--+-+-+
2611 |a| f|g|h|
2612 +-+--+-+-+
2613 |i|op|q|t|
2614 +-+--+r+-+
2615 |u| A|s|D|
2616 +-+ B+-+-+
2617
2618 +-+ B+-+-+
2619 |E| C|M|P|
2620 +-+--+N+-+
2621 |Q| X|O|Y|
2622 +-+--+-+-+
2623 |Z|56|7|8|
2624 +-+--+-+-+
2625 |9| efg|h|
2626 +-+--+-+-+
2627 |i| n|o|p|
2628 +-+--+-+-+
2629 ])
2630 AT_CLEANUP
2631
2632 AT_SETUP([double break 8x8, with joins, top and bottom headers])
2633 AT_KEYWORDS([render rendering])
2634 AT_DATA([input], [WEAVE_8X8([0 0 1 1])])
2635 AT_CHECK([render-test input --width=14 --length=14], [0], [dnl
2636 +-+-+-+-+-+-+
2637 |a|b|c|d|e|f|
2638 +-+-+-+-+-+-+
2639 |i|jkl|m|nop|
2640 +-+-+-+-+-+-+
2641 |u|v|wxy|z|A|
2642 +-+-+-+-+-+B|
2643 |E|F|I|JKL|C|
2644 +-+G+-+---+-+
2645 |Q|H|R|UVW|X|
2646 +-+-+-+-+-+-+
2647 |i|j|k|l|m|n|
2648 +-+-+-+-+-+-+
2649
2650 +-+-+-+-+-+-+
2651 |a|b|c|d|e|f|
2652 +-+-+-+-+-+-+
2653 |Z|0|S|3|456|
2654 | |1|T| |   |
2655 +-+2+-+-+-+-+
2656 |9| |abc|d|ef
2657 +-+-+-+-+-+-+
2658 |i|j|k|l|m|n|
2659 +-+-+-+-+-+-+
2660
2661 +-+-+
2662 |g|h|
2663 +-+-+
2664 |q|t|
2665 |r+-+
2666 |s|D|
2667 +-+-+
2668 |M|P|
2669 |N+-+
2670 |O|Y|
2671 +-+-+
2672 |o|p|
2673 +-+-+
2674
2675 +-+-+
2676 |g|h|
2677 +-+-+
2678 |7|8|
2679 | | |
2680 +-+-+
2681 fg|h|
2682 +-+-+
2683 |o|p|
2684 +-+-+
2685 ])
2686 AT_CHECK([render-test -o mb0 --min-break=0 input --width=14 --length=14], [0], [dnl
2687 +-+-+-+-+-+-+
2688 |a|b|c|d|e|f|
2689 +-+-+-+-+-+-+
2690 |i|jkl|m|nop|
2691 +-+-+-+-+-+-+
2692 |u|v|wxy|z|A|
2693 +-+-+-+-+-+B|
2694 |E|F|I|JKL|C|
2695 +-+G+-+---+-+
2696 |Q|H|R|UVW|X|
2697 +-+-+-+-+-+-+
2698 |i|j|k|l|m|n|
2699 +-+-+-+-+-+-+
2700
2701 +-+-+-+-+-+-+
2702 |a|b|c|d|e|f|
2703 +-+-+-+-+-+-+
2704 |Z|0|S|3|456|
2705 | |1|T| |   |
2706 +-+2+-+-+-+-+
2707 |9| |abc|d|ef
2708 +-+-+-+-+-+-+
2709 |i|j|k|l|m|n|
2710 +-+-+-+-+-+-+
2711
2712 +-+-+
2713 |g|h|
2714 +-+-+
2715 |q|t|
2716 |r+-+
2717 |s|D|
2718 +-+-+
2719 |M|P|
2720 |N+-+
2721 |O|Y|
2722 +-+-+
2723 |o|p|
2724 +-+-+
2725
2726 +-+-+
2727 |g|h|
2728 +-+-+
2729 |7|8|
2730 | | |
2731 +-+-+
2732 fg|h|
2733 +-+-+
2734 |o|p|
2735 +-+-+
2736 ])
2737 AT_CLEANUP
2738
2739 AT_SETUP([double break 8x8, with joins, all headers])
2740 AT_KEYWORDS([render rendering])
2741 AT_DATA([input], [WEAVE_8X8([1 1 1 1])])
2742 AT_CHECK([render-test input --width=14 --length=14], [0], [dnl
2743 +-+-+-+-+-+-+
2744 |a|b|c|d|e|h|
2745 +-+-+-+-+-+-+
2746 |i|jkl|m|n|t|
2747 +-+-+-+-+-+-+
2748 |u|v|wxy|z|D|
2749 +-+-+-+-+-+-+
2750 |E|F|I|JKL|P|
2751 +-+G+-+---+-+
2752 |Q|H|R|UVW|Y|
2753 +-+-+-+-+-+-+
2754 |i|j|k|l|m|p|
2755 +-+-+-+-+-+-+
2756
2757 +-+-+-+-+-+-+
2758 |a|b|c|d|e|h|
2759 +-+-+-+-+-+-+
2760 |Z|0|S|3|4|8|
2761 | |1|T| | | |
2762 +-+2+-+-+-+-+
2763 |9| |abc|d|h|
2764 +-+-+-+-+-+-+
2765 |i|j|k|l|m|p|
2766 +-+-+-+-+-+-+
2767
2768 +-+--+-+-+
2769 |a| f|g|h|
2770 +-+--+-+-+
2771 |i|op|q|t|
2772 +-+--+r+-+
2773 |u| A|s|D|
2774 +-+ B+-+-+
2775 |E| C|M|P|
2776 +-+--+N+-+
2777 |Q| X|O|Y|
2778 +-+--+-+-+
2779 |i| n|o|p|
2780 +-+--+-+-+
2781
2782 +-+--+-+-+
2783 |a| f|g|h|
2784 +-+--+-+-+
2785 |Z|56|7|8|
2786 | |  | | |
2787 +-+--+-+-+
2788 |9| efg|h|
2789 +-+--+-+-+
2790 |i| n|o|p|
2791 +-+--+-+-+
2792 ])
2793 AT_CHECK([render-test -o mb0 --min-break=0 input --width=14 --length=14], [0], [dnl
2794 +-+-+-+-+-+-+
2795 |a|b|c|d|e|h|
2796 +-+-+-+-+-+-+
2797 |i|jkl|m|n|t|
2798 +-+-+-+-+-+-+
2799 |u|v|wxy|z|D|
2800 +-+-+-+-+-+-+
2801 |E|F|I|JKL|P|
2802 +-+G+-+---+-+
2803 |Q|H|R|UVW|Y|
2804 +-+-+-+-+-+-+
2805 |i|j|k|l|m|p|
2806 +-+-+-+-+-+-+
2807
2808 +-+-+-+-+-+-+
2809 |a|b|c|d|e|h|
2810 +-+-+-+-+-+-+
2811 |Z|0|S|3|4|8|
2812 | |1|T| | | |
2813 +-+2+-+-+-+-+
2814 |9| |abc|d|h|
2815 +-+-+-+-+-+-+
2816 |i|j|k|l|m|p|
2817 +-+-+-+-+-+-+
2818
2819 +-+--+-+-+
2820 |a| f|g|h|
2821 +-+--+-+-+
2822 |i|op|q|t|
2823 +-+--+r+-+
2824 |u| A|s|D|
2825 +-+ B+-+-+
2826 |E| C|M|P|
2827 +-+--+N+-+
2828 |Q| X|O|Y|
2829 +-+--+-+-+
2830 |i| n|o|p|
2831 +-+--+-+-+
2832
2833 +-+--+-+-+
2834 |a| f|g|h|
2835 +-+--+-+-+
2836 |Z|56|7|8|
2837 | |  | | |
2838 +-+--+-+-+
2839 |9| efg|h|
2840 +-+--+-+-+
2841 |i| n|o|p|
2842 +-+--+-+-+
2843 ])
2844 AT_CLEANUP
2845
2846 AT_SETUP([double break joined cells too big for page])
2847 AT_KEYWORDS([render rendering])
2848 AT_DATA([input], [7 7
2849 @a
2850 @b
2851 @c
2852 @d
2853 @e
2854 @f
2855 @g
2856 @h
2857 6*6 @The MISSING subcommand determines the handling of missing variables.  If INCLUDE is set, then user‑missing values are included in the calculations.  If NOINCLUDE is set, which is the default, user‑missing values are excluded.
2858 @i
2859 @j
2860 @k
2861 @l
2862 @m
2863 ])
2864 AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl
2865 +-+--+--+---+
2866 |a| b| c|  d|
2867 +-+--+--+---+
2868 |h|       The
2869 | |        su
2870 +-+    determ
2871 |i|       han
2872 | |missing va
2873 | |If INCLUDE
2874 +-+ then user
2875 |j|        va
2876 | |   include
2877 | | calculati
2878 +-+ NOINCLUDE
2879
2880 +-+ NOINCLUDE
2881 |k|      whic
2882 | |
2883 | |      user
2884 +-+        va
2885 |l|         e
2886 | |
2887 | |
2888 +-+
2889 |m|
2890 | |
2891 +-+----------
2892
2893 +--+--+--+
2894 | e| f| g|
2895 +--+--+--+
2896 e MISSING|
2897 ubcommand|
2898 mines the|
2899 ndling of|
2900 ariables.|
2901 E is set,|
2902 r‑missing|
2903 alues are|
2904 ed in the|
2905 ions.  If|
2906 E is set,|
2907
2908 E is set,|
2909 ch is the|
2910  default,|
2911 r‑missing|
2912 alues are|
2913 excluded.|
2914          |
2915          |
2916          |
2917          |
2918          |
2919 ---------+
2920 ])
2921 AT_CHECK([render-test -o mb0 --min-break=0 --width=15 --length=15 input], [0], [dnl
2922 +-+--+--+---+-
2923 |a| b| c|  d|
2924 +-+--+--+---+-
2925 |h|       The
2926 | |        sub
2927 +-+    determi
2928 |i|       hand
2929 | |missing var
2930 | |If INCLUDE
2931 +-+ then user‑
2932 |j|        val
2933 | |   included
2934 | | calculatio
2935 +-+ NOINCLUDE
2936 |k|      which
2937
2938 | |          d
2939 | |      user‑
2940 +-+        val
2941 |l|         ex
2942 | |
2943 | |
2944 +-+
2945 |m|
2946 | |
2947 +-+-----------
2948
2949 -+--+--+
2950 e| f| g|
2951 -+--+--+
2952 MISSING|
2953
2954 command|
2955 nes the|
2956 ling of|
2957 iables.|
2958 is set,|
2959 missing|
2960 ues are|
2961  in the|
2962 ns.  If|
2963 is set,|
2964  is the|
2965 efault,|
2966 missing|
2967 ues are|
2968 cluded.|
2969
2970        |
2971        |
2972        |
2973        |
2974        |
2975 -------+
2976 ])
2977 AT_CLEANUP
2978 \f
2979 AT_BANNER([output rendering -- problematic procedures])
2980
2981 dnl LIST used to put columns right up next to each other without any
2982 dnl intervening space, so this checks for regression.
2983 AT_SETUP([LIST puts space between columns])
2984 AT_KEYWORDS([render rendering])
2985 AT_DATA([list.sps], [dnl
2986 DATA LIST LIST NOTABLE /x y z (F1.0).
2987 BEGIN DATA.
2988 1 2 3
2989 4 5 6
2990 7 8 9
2991 END DATA.
2992 LIST.
2993 ])
2994 AT_CHECK([pspp list.sps], [0], [dnl
2995 Data List
2996 x y z
2997 -----
2998 1 2 3
2999 4 5 6
3000 7 8 9
3001 ])
3002 AT_CLEANUP
3003
3004 # Long string variables tend to end in lots of spaces.  The ASCII
3005 # driver didn't handle this very well: it would essentially produce
3006 # one blank line in a cell for each trailing space.  This test
3007 # checks for regression.  See bug #38672.
3008 AT_SETUP([ASCII driver renders end of line spaces reasonably])
3009 AT_KEYWORDS([render rendering])
3010 AT_DATA([input], [dnl
3011 3 3
3012 @a
3013 @b
3014 @xyzzy                                          @&t@
3015 @d
3016 @e
3017 @f
3018 @g
3019 @h
3020 @i
3021 ])
3022 AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl
3023 +-+-+-----+
3024 |a|b|xyzzy|
3025 +-+-+-----+
3026 |d|e|    f|
3027 +-+-+-----+
3028 |g|h|    i|
3029 +-+-+-----+
3030 ])
3031 AT_CLEANUP
3032
3033 # There was a bug that, when multiple cells spanned a single column
3034 # (or row), only the dimensions of the cell nearest the bottom of the
3035 # table were actually considered.  This checks for regression.  (This
3036 # problem was most easily observed with SYSFILE INFO, which uses lots
3037 # of spanned cells).
3038 #
3039 # Without the fix, the output looks like this:
3040 # +-------+
3041 # | A long|
3042 # |   text|
3043 # |string.|
3044 # +-------+
3045 # |shorter|
3046 AT_SETUP([multiple spanned cells all contribute to dimensions])
3047 AT_KEYWORDS([render rendering])
3048 AT_DATA([input], [dnl
3049 2 2
3050 1*2 @A long text string.
3051 1*2 @shorter
3052 ])
3053 AT_CHECK([render-test --width=30 --length=15 input], [0], [dnl
3054 +-------------------+
3055 |A long text string.|
3056 +-------------------+
3057 |            shorter|
3058 +-------------------+
3059 ])
3060 AT_CLEANUP