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