csv: Change footnote format.
[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 # +-+---+-+-+-+
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 Footnote: a. Approximation.
266 Footnote: 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.
267 Footnote: c. One
268 Footnote: d. Two
269 Footnote: e. Three
270 ]])
271 AT_CLEANUP
272
273 AT_SETUP([6x6, joined rows and columns])
274 AT_KEYWORDS([render rendering])
275 AT_DATA([input], [WEAVE_6X6])
276 AT_CHECK([render-test input], [0], [dnl
277 +-+---+-+-+-+
278 |a|bcd|e|f|i|
279 +-+-+-+-+g+-+
280 |j|m|nop|h|q|
281 |k+-+-+-+-+r|
282 |l|t|w|xyz|s|
283 +-+u+-+-+-+-+
284 |A|v|B|E|FGH|
285 +-+-+C+-+-+-+
286 |IJK|D|L|O|P|
287 +-+-+-+M+-+-+
288 |Q|RST|N|U|V|
289 +-+---+-+-+-+
290 ])
291 AT_CLEANUP
292
293 AT_SETUP([3 rows with many joined cells])
294 AT_KEYWORDS([render rendering])
295 AT_CAPTURE_FILE([input])
296 AT_DATA([input], [3 19
297 m4_foreach([x], [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s], [x
298 ])@1
299 m4_for([x], [2], [19], [1], [1*2 @x
300 ])@20
301 ])
302 AT_CHECK([render-test input], [0], [dnl
303  a b c d e f g h i j k l m n o p q r  s
304 +-+---+---+---+---+---+---+---+---+----+
305 |1|  2|  3|  4|  5|  6|  7|  8|  9|  10|
306 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+
307 | 11| 12| 13| 14| 15| 16| 17| 18| 19|20|
308 +---+---+---+---+---+---+---+---+---+--+
309 ])
310 AT_CLEANUP
311
312 AT_SETUP([3 columns with many joined cells])
313 AT_KEYWORDS([render rendering])
314 AT_CAPTURE_FILE([input])
315 AT_DATA([input], [19 3
316 a
317 @1
318 2*1 @11\nab\ncd
319 b
320 2*1 @2\nab\ncd
321 c
322 2*1 @12\nab\ncd
323 d
324 2*1 @3\nab\ncd
325 e
326 2*1 @13\nab\ncd
327 f
328 2*1 @4\nab\ncd
329 g
330 2*1 @14\nab\ncd
331 h
332 2*1 @5\nab\ncd
333 i
334 2*1 @15\nab\ncd
335 j
336 2*1 @6\nab\ncd
337 k
338 2*1 @16\nab\ncd
339 l
340 2*1 @7\nab\ncd
341 m
342 2*1 @17\nab\ncd
343 n
344 2*1 @8\nab\ncd
345 o
346 2*1 @18\nab\ncd
347 p
348 2*1 @9\nab\ncd
349 q
350 2*1 @19\nab\ncd
351 r
352 2*1 @10\nab\ncd
353 s
354 @20
355 ])
356 AT_CHECK([render-test input], [0], [dnl
357  +--+--+
358 a| 1|11|
359  +--+ab|
360 b| 2|cd|
361  |ab+--+
362 c|cd|12|
363  +--+ab|
364 d| 3|cd|
365  |ab+--+
366 e|cd|13|
367  +--+ab|
368 f| 4|cd|
369  |ab+--+
370 g|cd|14|
371  +--+ab|
372 h| 5|cd|
373  |ab+--+
374 i|cd|15|
375  +--+ab|
376 j| 6|cd|
377  |ab+--+
378 k|cd|16|
379  +--+ab|
380 l| 7|cd|
381  |ab+--+
382 m|cd|17|
383  +--+ab|
384 n| 8|cd|
385  |ab+--+
386 o|cd|18|
387  +--+ab|
388 p| 9|cd|
389  |ab+--+
390 q|cd|19|
391  +--+ab|
392 r|10|cd|
393  |ab+--+
394 s|cd|20|
395  +--+--+
396 ])
397 AT_CLEANUP
398
399 AT_SETUP([joined rows])
400 AT_KEYWORDS([render rendering])
401 AT_DATA([input], [2 2
402 2*1 @ab\ncd\nef
403 @hij
404 @klm
405 ])
406 AT_CHECK([render-test input], [0], [dnl
407 +--+---+
408 |ab|hij|
409 |cd+---+
410 |ef|klm|
411 +--+---+
412 ])
413 AT_CLEANUP
414
415 dnl This checks for bug #31346, a segmentation fault that surfaced
416 dnl when two or more rows  had no unspanned cells and no rules.
417 AT_SETUP([joined rows only, no rules])
418 AT_KEYWORDS([render rendering])
419 AT_DATA([input], [2 2
420 2*1 ab\ncd\nef
421 2*1 hij\nklm\nnop
422 ])
423 AT_CHECK([render-test input], [0], [dnl
424 ab hij
425 cd klm
426 ef nop
427 ])
428 AT_CLEANUP
429
430 AT_SETUP([joined columns only, no rules])
431 AT_KEYWORDS([render rendering])
432 AT_DATA([input], [2 2
433 1*2 abc\ndef
434 1*2 hij\nklm\nnop
435 ])
436 AT_CHECK([render-test input], [0], [dnl
437  abc
438  def
439  hij
440  klm
441  nop
442 ])
443 AT_CLEANUP
444
445 AT_SETUP([5 big narrow cells])
446 AT_KEYWORDS([render rendering])
447 AT_DATA([input], [1 5
448 @This cell has a lot of text but its minimum width is pretty narrow.
449 @This cell also has a lot of text but its minimum width is pretty narrow.
450 @A third cell with a lot of text but a pretty narrow minimum width.
451 @A fourth cell with a lot of text but a pretty narrow minimum width.
452 @A fifth cell with a lot of text but a pretty narrow minimum width.
453 ])
454 AT_CHECK([render-test input], [0], [dnl
455 +---------------+---------------+--------------+---------------+--------------+
456 |This cell has a| This cell also|  A third cell|  A fourth cell|  A fifth cell|
457 |lot of text but|   has a lot of| with a lot of|  with a lot of| with a lot of|
458 |    its minimum|   text but its|    text but a|     text but a|    text but a|
459 |width is pretty|  minimum width| pretty narrow|  pretty narrow| pretty narrow|
460 |        narrow.|      is pretty|minimum width.| minimum width.|minimum width.|
461 |               |        narrow.|              |               |              |
462 +---------------+---------------+--------------+---------------+--------------+
463 ])
464 AT_CLEANUP
465
466 AT_SETUP([9 big narrow cells])
467 AT_KEYWORDS([render rendering])
468 AT_DATA([input], [1 9
469 @This cell has a lot of text but its minimum width is pretty narrow.
470 @This cell also has a lot of text but its minimum width is pretty narrow.
471 @A third cell with a lot of text but a pretty narrow minimum width.
472 @A fourth cell with a lot of text but a pretty narrow minimum width.
473 @A fifth cell with a lot of text but a pretty narrow minimum width.
474 @A sixth cell with a lot of text but a pretty narrow minimum width.
475 @A seventh cell with a lot of text but a pretty narrow minimum width.
476 @A eighth cell with a lot of text but a pretty narrow minimum width.
477 @A ninth cell with a lot of text but a pretty narrow minimum width.
478 ])
479 AT_CHECK([render-test input], [0], [dnl
480 +--------+-------+--------+--------+-------+--------+--------+-------+--------+
481 |    This|   This| A third|A fourth|A fifth| A sixth|       A|      A| A ninth|
482 |cell has|   cell|    cell|    cell|   cell|    cell| seventh| eighth|    cell|
483 |a lot of|   also|  with a|  with a| with a|  with a|    cell|   cell|  with a|
484 |text but|  has a|  lot of|  lot of| lot of|  lot of|  with a| with a|  lot of|
485 |     its| lot of|text but|text but|   text|text but|  lot of| lot of|text but|
486 | minimum|   text|a pretty|a pretty|  but a|a pretty|text but|   text|a pretty|
487 |width is|but its|  narrow|  narrow| pretty|  narrow|a pretty|  but a|  narrow|
488 |  pretty|minimum| minimum| minimum| narrow| minimum|  narrow| pretty| minimum|
489 | narrow.|  width|  width.|  width.|minimum|  width.| minimum| narrow|  width.|
490 |        |     is|        |        | width.|        |  width.|minimum|        |
491 |        | pretty|        |        |       |        |        | width.|        |
492 |        |narrow.|        |        |       |        |        |       |        |
493 +--------+-------+--------+--------+-------+--------+--------+-------+--------+
494 ])
495 AT_CLEANUP
496
497 AT_SETUP([2 big cells with new-lines])
498 AT_KEYWORDS([render rendering])
499 AT_DATA([input], [1 2
500 @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.
501 @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.
502 ])
503 AT_CHECK([render-test input], [0], [dnl
504 +----------------------------------------------------------+------------------+
505 |      PSPP does not place many restrictions on ordering of|     PSPP includes|
506 |  commands. The main restriction is that variables must be|   special support|
507 |       defined before they are otherwise referenced.  This|       for unknown|
508 |    section describes the details of command ordering, but|      numeric data|
509 |       most users will have no need to refer to them. PSPP|           values.|
510 |     possesses five internal states, called initial, INPUT|           Missing|
511 | PROGRAM, FILE TYPE, transformation, and procedure states.|  observations are|
512 |                                                          |          assigned|
513 |                                                          |  a special value,|
514 |                                                          |        called the|
515 |                                                          |  ``system‑missing|
516 |                                                          |    value''.  This|
517 |                                                          |``value'' actually|
518 |                                                          |     indicates the|
519 |                                                          |      absence of a|
520 |                                                          |         value; it|
521 |                                                          |    means that the|
522 |                                                          |            actual|
523 |                                                          | value is unknown.|
524 +----------------------------------------------------------+------------------+
525 ])
526 AT_CLEANUP
527
528 AT_SETUP([8x8 with many 2x2 joins])
529 AT_KEYWORDS([render rendering])
530 AT_DATA([input], [WEAVE_8X8_2])
531 AT_CHECK([render-test input], [0],[dnl
532 +---+---+----+----+
533 |abc|jkl| mno| vwx|
534 |def|   | pqr|    |
535 |ghi+---+ stu+----+
536 |   |yzA|    | HIJ|
537 +-+-+BCD+-+--+ KLM|
538 |Q|V|EFG|W| Z| NOP|
539 |R| |   |X|  |    |
540 |S+-+-+-+Y+--+-+--+
541 |T|012|9| | abc| j|
542 |U|345| | | def| k|
543 | |678+-+-+ ghi| l|
544 | |   |opq|    | m|
545 +-+-+-+rst+----+ n|
546 |xyz|G|uvw| JKL|  |
547 |ABC|H|   |    |  |
548 |DEF|I+---+--+-+--+
549 |   | | MNOPQ| 123|
550 +---+-+ RSTUV| 456|
551 |abcde| WXYZ0| 789|
552 |     |      |    |
553 +-----+------+----+
554 ])
555 AT_CLEANUP
556
557
558 AT_SETUP([ASCII driver Unicode box characters])
559 AT_KEYWORDS([render rendering])
560 AT_DATA([input], [3 3
561 1*2 @abc
562 2*1 @d\ne\nf
563 2*1 @g\nh\ni
564 @j
565 1*2 @klm
566 ])
567 AT_CHECK([render-test --box=unicode input], [0], [dnl
568 ╭───┬─╮
569 │abc│d│
570 ├─┬─┤e│
571 │g│j│f│
572 │h├─┴─┤
573 │i│klm│
574 ╰─┴───╯
575 ])
576 AT_CLEANUP
577 \f
578 AT_BANNER([output rendering -- horizontal page breaks])
579
580 AT_SETUP([breaking row of many small cells])
581 AT_KEYWORDS([render rendering])
582 AT_CAPTURE_FILE([input])
583 AT_DATA([input], [1 50
584 m4_for([x], [1], [50], [1], [@x
585 ])])
586 AT_CHECK([render-test input], [0], [dnl
587 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
588 |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|
589 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
590
591 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
592 |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|
593 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
594 ])
595 AT_CHECK([render-test input -o mb0 --min-break=0], [0], [dnl
596 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
597 |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|
598 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
599
600 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
601 |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|
602 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
603 ])
604 AT_CLEANUP
605
606 AT_SETUP([breaking row of many small cells, with headers])
607 AT_KEYWORDS([render rendering])
608 AT_CAPTURE_FILE([input])
609 AT_DATA([input], [1 54 2 2
610 @ha
611 @hb
612 m4_for([x], [1], [50], [1], [@x
613 ])dnl
614 @hc
615 @hd
616 ])
617 AT_CHECK([render-test input], [0], [dnl
618 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
619 |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|
620 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
621
622 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
623 |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|
624 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
625
626 +--+--+--+--+--+--+--+
627 |ha|hb|48|49|50|hc|hd|
628 +--+--+--+--+--+--+--+
629 ])
630 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
631 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
632 |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|
633 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
634
635 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
636 |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|
637 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
638
639 +--+--+--+--+--+--+--+
640 |ha|hb|48|49|50|hc|hd|
641 +--+--+--+--+--+--+--+
642 ])
643 AT_CLEANUP
644
645 AT_SETUP([breaking row of many medium-size cells])
646 AT_KEYWORDS([render rendering])
647 AT_CAPTURE_FILE([input])
648 AT_DATA([input], [1 50
649 m4_for([x], [1], [50], [1], [@cell x
650 ])])
651 AT_CHECK([render-test input], [0], [dnl
652 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
653 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
654 |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  13|  14|  15|
655 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
656
657 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
658 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
659 |  16|  17|  18|  19|  20|  21|  22|  23|  24|  25|  26|  27|  28|  29|  30|
660 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
661
662 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
663 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
664 |  31|  32|  33|  34|  35|  36|  37|  38|  39|  40|  41|  42|  43|  44|  45|
665 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
666
667 +----+----+----+----+----+
668 |cell|cell|cell|cell|cell|
669 |  46|  47|  48|  49|  50|
670 +----+----+----+----+----+
671 ])
672 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
673 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
674 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cel
675 |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  13|  14|  15|  1
676 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
677
678 -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
679 l|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce
680 6|  17|  18|  19|  20|  21|  22|  23|  24|  25|  26|  27|  28|  29|  30|  31|
681 -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
682
683 --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
684 ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|c
685 32|  33|  34|  35|  36|  37|  38|  39|  40|  41|  42|  43|  44|  45|  46|  47|
686 --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
687
688 ---+----+----+
689 ell|cell|cell|
690  48|  49|  50|
691 ---+----+----+
692 ])
693 AT_CLEANUP
694
695 AT_SETUP([breaking row of many medium-size cells, with headers])
696 AT_KEYWORDS([render rendering])
697 AT_CAPTURE_FILE([input])
698 AT_DATA([input], [1 52 1 1
699 header1
700 m4_for([x], [1], [50], [1], [@cell x
701 ])dnl
702 header2
703 ])
704 AT_CHECK([render-test input], [0], [dnl
705        +----+----+----+----+----+----+----+----+----+----+----+----+
706 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
707        |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|
708        +----+----+----+----+----+----+----+----+----+----+----+----+
709
710        +----+----+----+----+----+----+----+----+----+----+----+----+
711 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
712        |  13|  14|  15|  16|  17|  18|  19|  20|  21|  22|  23|  24|
713        +----+----+----+----+----+----+----+----+----+----+----+----+
714
715        +----+----+----+----+----+----+----+----+----+----+----+----+
716 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
717        |  25|  26|  27|  28|  29|  30|  31|  32|  33|  34|  35|  36|
718        +----+----+----+----+----+----+----+----+----+----+----+----+
719
720        +----+----+----+----+----+----+----+----+----+----+----+----+
721 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
722        |  37|  38|  39|  40|  41|  42|  43|  44|  45|  46|  47|  48|
723        +----+----+----+----+----+----+----+----+----+----+----+----+
724
725        +----+----+
726 header1|cell|cell|header2
727        |  49|  50|
728        +----+----+
729 ])
730 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
731        +----+----+----+----+----+----+----+----+----+----+----+----+--+
732 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2
733        |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  |
734        +----+----+----+----+----+----+----+----+----+----+----+----+--+
735
736        +--+----+----+----+----+----+----+----+----+----+----+----+----+
737 header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
738        |13|  14|  15|  16|  17|  18|  19|  20|  21|  22|  23|  24|  25|
739        +--+----+----+----+----+----+----+----+----+----+----+----+----+
740
741        +----+----+----+----+----+----+----+----+----+----+----+----+--+
742 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2
743        |  26|  27|  28|  29|  30|  31|  32|  33|  34|  35|  36|  37|  |
744        +----+----+----+----+----+----+----+----+----+----+----+----+--+
745
746        +--+----+----+----+----+----+----+----+----+----+----+----+----+
747 header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
748        |38|  39|  40|  41|  42|  43|  44|  45|  46|  47|  48|  49|  50|
749        +--+----+----+----+----+----+----+----+----+----+----+----+----+
750 ])
751 AT_CLEANUP
752
753 AT_SETUP([breaking row of many big narrow cells])
754 AT_KEYWORDS([render rendering])
755 AT_CAPTURE_FILE([input])
756 AT_DATA([input], [1 50
757 m4_for([x], [1], [50], [1], [@This is cell x in a series of 50.
758 ])])
759 AT_CHECK([render-test input], [0], [dnl
760 +------+------+------+------+------+------+------+------+------+------+------+
761 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
762 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
763 |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9|  cell|  cell|
764 |  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a| 10 in| 11 in|
765 |series|series|series|series|series|series|series|series|series|     a|     a|
766 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|
767 |      |      |      |      |      |      |      |      |      |of 50.|of 50.|
768 +------+------+------+------+------+------+------+------+------+------+------+
769
770 +------+------+------+------+------+------+------+------+------+------+------+
771 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
772 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
773 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
774 | 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in|
775 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
776 |series|series|series|series|series|series|series|series|series|series|series|
777 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
778 +------+------+------+------+------+------+------+------+------+------+------+
779
780 +------+------+------+------+------+------+------+------+------+------+------+
781 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
782 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
783 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
784 | 23 in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in|
785 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
786 |series|series|series|series|series|series|series|series|series|series|series|
787 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
788 +------+------+------+------+------+------+------+------+------+------+------+
789
790 +------+------+------+------+------+------+------+------+------+------+------+
791 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
792 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
793 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
794 | 34 in| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in|
795 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
796 |series|series|series|series|series|series|series|series|series|series|series|
797 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
798 +------+------+------+------+------+------+------+------+------+------+------+
799
800 +------+------+------+------+------+------+
801 |  This|  This|  This|  This|  This|  This|
802 |    is|    is|    is|    is|    is|    is|
803 |  cell|  cell|  cell|  cell|  cell|  cell|
804 | 45 in| 46 in| 47 in| 48 in| 49 in| 50 in|
805 |     a|     a|     a|     a|     a|     a|
806 |series|series|series|series|series|series|
807 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
808 +------+------+------+------+------+------+
809 ])
810 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
811 +------+------+------+------+------+------+------+------+------+------+------+-
812 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
813 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
814 |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9|  cell|  cell|
815 |  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a| 10 in| 11 in|
816 |series|series|series|series|series|series|series|series|series|     a|     a|
817 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|s
818 |      |      |      |      |      |      |      |      |      |of 50.|of 50.|o
819 +------+------+------+------+------+------+------+------+------+------+------+-
820
821 -----+------+------+------+------+------+------+------+------+------+------+---
822  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  T
823    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
824  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  c
825 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in| 23
826     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
827 eries|series|series|series|series|series|series|series|series|series|series|ser
828 f 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of
829 -----+------+------+------+------+------+------+------+------+------+------+---
830
831 ---+------+------+------+------+------+------+------+------+------+------+-----
832 his|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  Thi
833  is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    i
834 ell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cel
835  in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in| 34 i
836   a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
837 ies|series|series|series|series|series|series|series|series|series|series|serie
838 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50
839 ---+------+------+------+------+------+------+------+------+------+------+-----
840
841 -+------+------+------+------+------+------+------+------+------+------+------+
842 s|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
843 s|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
844 l|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
845 n| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in| 45 in|
846 a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
847 s|series|series|series|series|series|series|series|series|series|series|series|
848 .|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
849 -+------+------+------+------+------+------+------+------+------+------+------+
850
851 +------+------+------+------+------+
852 |  This|  This|  This|  This|  This|
853 |    is|    is|    is|    is|    is|
854 |  cell|  cell|  cell|  cell|  cell|
855 | 46 in| 47 in| 48 in| 49 in| 50 in|
856 |     a|     a|     a|     a|     a|
857 |series|series|series|series|series|
858 |of 50.|of 50.|of 50.|of 50.|of 50.|
859 +------+------+------+------+------+
860 ])
861 AT_CLEANUP
862
863 AT_SETUP([breaking 2 rows of many small cells])
864 AT_KEYWORDS([render rendering])
865 AT_CAPTURE_FILE([input])
866 AT_DATA([input], [2 50
867 m4_for([x], [1], [100], [1], [@x
868 ])])
869 AT_CHECK([render-test input], [0], [dnl
870 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
871 | 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|
872 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
873 |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|
874 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
875
876 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
877 |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50|
878 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
879 |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|
880 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
881 ])
882 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
883 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
884 | 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|
885 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
886 |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|
887 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
888
889 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
890 |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50|
891 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
892 |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|
893 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
894 ])
895 AT_CLEANUP
896
897 AT_SETUP([breaking 3 rows with many joined cells])
898 AT_KEYWORDS([render rendering])
899 AT_CAPTURE_FILE([input])
900 AT_DATA([input], [3 49
901 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
902 A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W], [var
903 ])@1
904 m4_for([x], [2], [49], [1], [1*2 @x
905 ])@50
906 ])
907 AT_CHECK([render-test input], [0], [dnl
908  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
909 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
910 |1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20|
911 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
912 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4
913 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
914
915  N O P Q R S T U V  W
916 +---+---+---+---+----+
917 | 21| 22| 23| 24|  25|
918 +-+-+-+-+-+-+-+-+-+--+
919 45| 46| 47| 48| 49|50|
920 --+---+---+---+---+--+
921 ])
922 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
923  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
924 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
925 |1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20|
926 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
927 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4
928 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
929
930  N O P Q R S T U V  W
931 +---+---+---+---+----+
932 | 21| 22| 23| 24|  25|
933 +-+-+-+-+-+-+-+-+-+--+
934 45| 46| 47| 48| 49|50|
935 --+---+---+---+---+--+
936 ])
937 AT_CLEANUP
938
939 AT_SETUP([horz break 6x6, joined rows and columns])
940 AT_KEYWORDS([render rendering])
941 AT_DATA([input], [WEAVE_6X6])
942 AT_DATA([expout], [dnl
943 +-+--
944 |a|bc
945 +-+-+
946 |j|m|
947 |k+-+
948 |l|t|
949 +-+u|
950 |A|v|
951 +-+-+
952 |IJK|
953 +-+-+
954 |Q|RS
955 +-+--
956
957 --+-+
958 cd|e|
959 +-+-+
960 |nop|
961 +-+-+
962 |w|xy
963 +-+-+
964 |B|E|
965 |C+-+
966 |D|L|
967 +-+M|
968 ST|N|
969 --+-+
970
971 +-+-+
972 |f|i|
973 |g+-+
974 |h|q|
975 +-+r|
976 yz|s|
977 +-+-+
978 |FGH|
979 +-+-+
980 |O|P|
981 +-+-+
982 |U|V|
983 +-+-+
984 ])
985 AT_CHECK([render-test --width=6 input], [0], [expout])
986 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout])
987 AT_CLEANUP
988
989 AT_SETUP([horz break 6x6, joined rows and columns, left header])
990 AT_KEYWORDS([render rendering])
991 AT_DATA([input], [WEAVE_6X6([1 0 0 0])])
992 AT_DATA([expout], [dnl
993 +-+---+-+
994 |a|bcd|e|
995 +-+-+-+-+
996 |j|m|nop|
997 |k+-+-+-+
998 |l|t|w|xy
999 +-+u+-+-+
1000 |A|v|B|E|
1001 +-+-+C+-+
1002 |K K|D|L|
1003 +-+-+-+M|
1004 |Q|RST|N|
1005 +-+---+-+
1006
1007 +-+-+-+
1008 |a|f|i|
1009 +-+g+-+
1010 |j|h|q|
1011 |k+-+r|
1012 |l|z|s|
1013 +-+-+-+
1014 |A|FGH|
1015 +-+-+-+
1016 |K|O|P|
1017 +-+-+-+
1018 |Q|U|V|
1019 +-+-+-+
1020 ])
1021 AT_CHECK([render-test --width=10 input], [0], [expout])
1022 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout])
1023 AT_CLEANUP
1024
1025 AT_SETUP([horz break 6x6, joined rows and columns, right header])
1026 AT_KEYWORDS([render rendering])
1027 AT_DATA([input], [WEAVE_6X6([0 1 0 0])])
1028 AT_DATA([expout], [dnl
1029 +-+---+-+
1030 |a|bcd|i|
1031 +-+-+-+-+
1032 |j|m|n|q|
1033 |k+-+-+r|
1034 |l|t|w|s|
1035 +-+u+-+-+
1036 |A|v|B|H|
1037 +-+-+C+-+
1038 |IJK|D|P|
1039 +-+-+-+-+
1040 |Q|RST|V|
1041 +-+---+-+
1042
1043 +-+-+-+
1044 |e|f|i|
1045 +-+g+-+
1046 op|h|q|
1047 +-+-+r|
1048 |xyz|s|
1049 +-+-+-+
1050 |E|H H|
1051 +-+-+-+
1052 |L|O|P|
1053 |M+-+-+
1054 |N|U|V|
1055 +-+-+-+
1056 ])
1057 AT_CHECK([render-test --width=10 input], [0], [expout])
1058 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout])
1059 AT_CLEANUP
1060
1061 AT_SETUP([breaking joined cells too wide for page])
1062 AT_KEYWORDS([render rendering])
1063 AT_DATA([input], [4 6
1064 1*6 @abc def ghi jkl
1065 1*3 @mno pqr
1066 1*3 @stu vwx
1067 1*2 @yzA
1068 1*2 @BCD
1069 1*2 @EFG
1070 @H
1071 @I
1072 @J
1073 @K
1074 @L
1075 @M
1076 ])
1077 AT_CHECK([render-test --width=10 input], [0], [dnl
1078 +--------
1079 |abc def
1080 |
1081 +-----+--
1082 |  mno|
1083 |  pqr|
1084 +---+-+-+
1085 |yzA|BCD|
1086 +-+-+-+-+
1087 |H|I|J|K|
1088 +-+-+-+-+
1089
1090 ----+
1091  ghi|
1092  jkl|
1093 ----+
1094  stu|
1095  vwx|
1096 +---+
1097 |EFG|
1098 +-+-+
1099 |L|M|
1100 +-+-+
1101 ])
1102 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [dnl
1103 +--------
1104 |abc def
1105 |
1106 +-----+--
1107 |  mno|
1108 |  pqr|
1109 +---+-+-+
1110 |yzA|BCD|
1111 +-+-+-+-+
1112 |H|I|J|K|
1113 +-+-+-+-+
1114
1115 ----+
1116  ghi|
1117  jkl|
1118 ----+
1119  stu|
1120  vwx|
1121 +---+
1122 |EFG|
1123 +-+-+
1124 |L|M|
1125 +-+-+
1126 ])
1127 AT_CLEANUP
1128
1129 AT_SETUP([breaking joined cells much too wide for page])
1130 AT_KEYWORDS([render rendering])
1131 AT_DATA([input], [4 6
1132 1*6 @abc def ghi jkl
1133 1*3 @mno pqr
1134 1*3 @stu vwx
1135 1*2 @yzA
1136 1*2 @BCD
1137 1*2 @EFG
1138 @H
1139 @I
1140 @J
1141 @K
1142 @L
1143 @M
1144 ])
1145 AT_CHECK([render-test --width=6 input], [0], [dnl
1146 +----
1147 |abc
1148 |
1149 +----
1150 |  mn
1151 |  pq
1152 +---+
1153 |yzA|
1154 +-+-+
1155 |H|I|
1156 +-+-+
1157
1158 -----
1159  def
1160
1161 --+--
1162 no|
1163 qr|
1164 +-+-+
1165 |BCD|
1166 +-+-+
1167 |J|K|
1168 +-+-+
1169
1170 ----+
1171  ghi|
1172  jkl|
1173 ----+
1174  stu|
1175  vwx|
1176 +---+
1177 |EFG|
1178 +-+-+
1179 |L|M|
1180 +-+-+
1181 ])
1182 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl
1183 +----
1184 |abc
1185 |
1186 +----
1187 |  mn
1188 |  pq
1189 +---+
1190 |yzA|
1191 +-+-+
1192 |H|I|
1193 +-+-+
1194
1195 -----
1196  def
1197
1198 --+--
1199 no|
1200 qr|
1201 +-+-+
1202 |BCD|
1203 +-+-+
1204 |J|K|
1205 +-+-+
1206
1207 ----+
1208  ghi|
1209  jkl|
1210 ----+
1211  stu|
1212  vwx|
1213 +---+
1214 |EFG|
1215 +-+-+
1216 |L|M|
1217 +-+-+
1218 ])
1219 AT_CLEANUP
1220
1221 AT_SETUP([breaking cell too wide for page, no border])
1222 AT_KEYWORDS([render rendering])
1223 AT_CAPTURE_FILE([input])
1224 AT_DATA([input], [1 1
1225 abcdefghijklmnopqrstuvwxyz
1226 ])
1227 AT_CHECK([render-test --width=6 input], [0], [dnl
1228 abcdef
1229
1230 ghijkl
1231
1232 mnopqr
1233
1234 stuvwx
1235
1236 yz
1237 ])
1238 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl
1239 abcdef
1240
1241 ghijkl
1242
1243 mnopqr
1244
1245 stuvwx
1246
1247 yz
1248 ])
1249 AT_CLEANUP
1250
1251 AT_SETUP([breaking cell too wide for page, with border])
1252 AT_KEYWORDS([render rendering])
1253 AT_CAPTURE_FILE([input])
1254 AT_DATA([input], [1 1
1255 @abcdefghijklmnopqrstuvwxyz
1256 ])
1257 AT_DATA([expout], [dnl
1258 +-----
1259 |abcde
1260 +-----
1261
1262 ------
1263 fghijk
1264 ------
1265
1266 ------
1267 lmnopq
1268 ------
1269
1270 ------
1271 rstuvw
1272 ------
1273
1274 ---+
1275 xyz|
1276 ---+
1277 ])
1278 AT_CHECK([render-test --width=6 input], [0], [expout])
1279 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout])
1280 AT_CLEANUP
1281
1282 AT_SETUP([horz break 8x8 with many 2x2 joins])
1283 AT_KEYWORDS([render rendering])
1284 AT_DATA([input], [WEAVE_8X8_2])
1285 AT_CHECK([render-test --width=8 input], [0],[dnl
1286 +---+--
1287 |abc|jk
1288 |def|
1289 |ghi+--
1290 |   |yz
1291 +-+-+BC
1292 |Q|V|EF
1293 |R| |
1294 |S+-+-+
1295 |T|012|
1296 |U|345|
1297 | |678|
1298 | |   |
1299 +-+-+-+
1300 |xyz|G|
1301 |ABC|H|
1302 |DEF|I|
1303 |   | |
1304 +---+-+
1305 |abcde|
1306 |     |
1307 +-----+
1308
1309 --+----+
1310 kl| mno|
1311   | pqr|
1312 --+ stu|
1313 zA|    |
1314 CD+-+--+
1315 FG|W| Z|
1316   |X|  |
1317 +-+Y+--+
1318 |9| | ab
1319 | | | de
1320 +-+-+ gh
1321 |opq|
1322 |rst+---
1323 |uvw| JK
1324 |   |
1325 +---+--+
1326 | MNOPQ|
1327 | RSTUV|
1328 | WXYZ0|
1329 |      |
1330 +------+
1331
1332 +----+
1333 | vwx|
1334 |    |
1335 +----+
1336 | HIJ|
1337 | KLM|
1338 | NOP|
1339 |    |
1340 +-+--+
1341 bc| j|
1342 ef| k|
1343 hi| l|
1344   | m|
1345 --+ n|
1346 KL|  |
1347   |  |
1348 +-+--+
1349 | 123|
1350 | 456|
1351 | 789|
1352 |    |
1353 +----+
1354 ])
1355 AT_CHECK([render-test -o mb0 --min-break=0 --width=8 input], [0],[dnl
1356 +---+--
1357 |abc|jk
1358 |def|
1359 |ghi+--
1360 |   |yz
1361 +-+-+BC
1362 |Q|V|EF
1363 |R| |
1364 |S+-+-+
1365 |T|012|
1366 |U|345|
1367 | |678|
1368 | |   |
1369 +-+-+-+
1370 |xyz|G|
1371 |ABC|H|
1372 |DEF|I|
1373 |   | |
1374 +---+-+
1375 |abcde|
1376 |     |
1377 +-----+
1378
1379 --+----+
1380 kl| mno|
1381   | pqr|
1382 --+ stu|
1383 zA|    |
1384 CD+-+--+
1385 FG|W| Z|
1386   |X|  |
1387 +-+Y+--+
1388 |9| | ab
1389 | | | de
1390 +-+-+ gh
1391 |opq|
1392 |rst+---
1393 |uvw| JK
1394 |   |
1395 +---+--+
1396 | MNOPQ|
1397 | RSTUV|
1398 | WXYZ0|
1399 |      |
1400 +------+
1401
1402 +----+
1403 | vwx|
1404 |    |
1405 +----+
1406 | HIJ|
1407 | KLM|
1408 | NOP|
1409 |    |
1410 +-+--+
1411 bc| j|
1412 ef| k|
1413 hi| l|
1414   | m|
1415 --+ n|
1416 KL|  |
1417   |  |
1418 +-+--+
1419 | 123|
1420 | 456|
1421 | 789|
1422 |    |
1423 +----+
1424 ])
1425 AT_CLEANUP
1426 \f
1427 AT_BANNER([output rendering -- problematic procedures])
1428
1429 dnl LIST used to put columns right up next to each other without any
1430 dnl intervening space, so this checks for regression.
1431 AT_SETUP([LIST puts space between columns])
1432 AT_KEYWORDS([render rendering])
1433 AT_DATA([list.sps], [dnl
1434 DATA LIST LIST NOTABLE /x y z (F1.0).
1435 BEGIN DATA.
1436 1 2 3
1437 4 5 6
1438 7 8 9
1439 END DATA.
1440 LIST.
1441 ])
1442 AT_CHECK([pspp list.sps], [0], [dnl
1443 Data List
1444 +-+-+-+
1445 |x|y|z|
1446 +-+-+-+
1447 |1|2|3|
1448 |4|5|6|
1449 |7|8|9|
1450 +-+-+-+
1451 ])
1452 AT_CLEANUP
1453
1454 # Long string variables tend to end in lots of spaces.  The ASCII
1455 # driver didn't handle this very well: it would essentially produce
1456 # one blank line in a cell for each trailing space.  This test
1457 # checks for regression.  See bug #38672.
1458 AT_SETUP([ASCII driver renders end of line spaces reasonably])
1459 AT_KEYWORDS([render rendering])
1460 AT_DATA([input], [dnl
1461 3 3
1462 @a
1463 @b
1464 @xyzzy                                          @&t@
1465 @d
1466 @e
1467 @f
1468 @g
1469 @h
1470 @i
1471 ])
1472 AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl
1473 +-+-+-----+
1474 |a|b|xyzzy|
1475 +-+-+-----+
1476 |d|e|    f|
1477 +-+-+-----+
1478 |g|h|    i|
1479 +-+-+-----+
1480 ])
1481 AT_CLEANUP
1482
1483 # There was a bug that, when multiple cells spanned a single column
1484 # (or row), only the dimensions of the cell nearest the bottom of the
1485 # table were actually considered.  This checks for regression.  (This
1486 # problem was most easily observed with SYSFILE INFO, which uses lots
1487 # of spanned cells).
1488 #
1489 # Without the fix, the output looks like this:
1490 # +-------+
1491 # | A long|
1492 # |   text|
1493 # |string.|
1494 # +-------+
1495 # |shorter|
1496 AT_SETUP([multiple spanned cells all contribute to dimensions])
1497 AT_KEYWORDS([render rendering])
1498 AT_DATA([input], [dnl
1499 2 2
1500 1*2 @A long text string.
1501 1*2 @shorter
1502 ])
1503 AT_CHECK([render-test --width=30 --length=15 input], [0], [dnl
1504 +--------------------+
1505 | A long text string.|
1506 +--------------------+
1507 |             shorter|
1508 +--------------------+
1509 ])
1510 AT_CLEANUP