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