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