9f0140d9fd770340c1c0966b0d8813b27a2c1fff
[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 \f
559 AT_BANNER([output rendering -- horizontal page breaks])
560
561 AT_SETUP([breaking row of many small cells])
562 AT_KEYWORDS([render rendering])
563 AT_CAPTURE_FILE([input])
564 AT_DATA([input], [1 50
565 m4_for([x], [1], [50], [1], [@x
566 ])])
567 AT_CHECK([render-test input], [0], [dnl
568 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
569 |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|
570 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
571
572 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
573 |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|
574 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
575 ])
576 AT_CHECK([render-test input -o mb0 --min-break=0], [0], [dnl
577 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
578 |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|
579 +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
580
581 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
582 |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|
583 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
584 ])
585 AT_CLEANUP
586
587 AT_SETUP([breaking row of many small cells, with headers])
588 AT_KEYWORDS([render rendering])
589 AT_CAPTURE_FILE([input])
590 AT_DATA([input], [1 54 2 2
591 @ha
592 @hb
593 m4_for([x], [1], [50], [1], [@x
594 ])dnl
595 @hc
596 @hd
597 ])
598 AT_CHECK([render-test input], [0], [dnl
599 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
600 |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|
601 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
602
603 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
604 |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|
605 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
606
607 +--+--+--+--+--+--+--+
608 |ha|hb|48|49|50|hc|hd|
609 +--+--+--+--+--+--+--+
610 ])
611 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
612 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
613 |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|
614 +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
615
616 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
617 |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|
618 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
619
620 +--+--+--+--+--+--+--+
621 |ha|hb|48|49|50|hc|hd|
622 +--+--+--+--+--+--+--+
623 ])
624 AT_CLEANUP
625
626 AT_SETUP([breaking row of many medium-size cells])
627 AT_KEYWORDS([render rendering])
628 AT_CAPTURE_FILE([input])
629 AT_DATA([input], [1 50
630 m4_for([x], [1], [50], [1], [@cell x
631 ])])
632 AT_CHECK([render-test input], [0], [dnl
633 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
634 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
635 |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  13|  14|  15|
636 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
637
638 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
639 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
640 |  16|  17|  18|  19|  20|  21|  22|  23|  24|  25|  26|  27|  28|  29|  30|
641 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
642
643 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
644 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|
645 |  31|  32|  33|  34|  35|  36|  37|  38|  39|  40|  41|  42|  43|  44|  45|
646 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
647
648 +----+----+----+----+----+
649 |cell|cell|cell|cell|cell|
650 |  46|  47|  48|  49|  50|
651 +----+----+----+----+----+
652 ])
653 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
654 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
655 |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cel
656 |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  13|  14|  15|  1
657 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
658
659 -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
660 l|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce
661 6|  17|  18|  19|  20|  21|  22|  23|  24|  25|  26|  27|  28|  29|  30|  31|
662 -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
663
664 --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
665 ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|c
666 32|  33|  34|  35|  36|  37|  38|  39|  40|  41|  42|  43|  44|  45|  46|  47|
667 --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
668
669 ---+----+----+
670 ell|cell|cell|
671  48|  49|  50|
672 ---+----+----+
673 ])
674 AT_CLEANUP
675
676 AT_SETUP([breaking row of many medium-size cells, with headers])
677 AT_KEYWORDS([render rendering])
678 AT_CAPTURE_FILE([input])
679 AT_DATA([input], [1 52 1 1
680 header1
681 m4_for([x], [1], [50], [1], [@cell x
682 ])dnl
683 header2
684 ])
685 AT_CHECK([render-test input], [0], [dnl
686        +----+----+----+----+----+----+----+----+----+----+----+----+
687 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
688        |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|
689        +----+----+----+----+----+----+----+----+----+----+----+----+
690
691        +----+----+----+----+----+----+----+----+----+----+----+----+
692 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
693        |  13|  14|  15|  16|  17|  18|  19|  20|  21|  22|  23|  24|
694        +----+----+----+----+----+----+----+----+----+----+----+----+
695
696        +----+----+----+----+----+----+----+----+----+----+----+----+
697 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
698        |  25|  26|  27|  28|  29|  30|  31|  32|  33|  34|  35|  36|
699        +----+----+----+----+----+----+----+----+----+----+----+----+
700
701        +----+----+----+----+----+----+----+----+----+----+----+----+
702 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
703        |  37|  38|  39|  40|  41|  42|  43|  44|  45|  46|  47|  48|
704        +----+----+----+----+----+----+----+----+----+----+----+----+
705
706        +----+----+
707 header1|cell|cell|header2
708        |  49|  50|
709        +----+----+
710 ])
711 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
712        +----+----+----+----+----+----+----+----+----+----+----+----+--+
713 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2
714        |   1|   2|   3|   4|   5|   6|   7|   8|   9|  10|  11|  12|  |
715        +----+----+----+----+----+----+----+----+----+----+----+----+--+
716
717        +--+----+----+----+----+----+----+----+----+----+----+----+----+
718 header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
719        |13|  14|  15|  16|  17|  18|  19|  20|  21|  22|  23|  24|  25|
720        +--+----+----+----+----+----+----+----+----+----+----+----+----+
721
722        +----+----+----+----+----+----+----+----+----+----+----+----+--+
723 header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2
724        |  26|  27|  28|  29|  30|  31|  32|  33|  34|  35|  36|  37|  |
725        +----+----+----+----+----+----+----+----+----+----+----+----+--+
726
727        +--+----+----+----+----+----+----+----+----+----+----+----+----+
728 header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2
729        |38|  39|  40|  41|  42|  43|  44|  45|  46|  47|  48|  49|  50|
730        +--+----+----+----+----+----+----+----+----+----+----+----+----+
731 ])
732 AT_CLEANUP
733
734 AT_SETUP([breaking row of many big narrow cells])
735 AT_KEYWORDS([render rendering])
736 AT_CAPTURE_FILE([input])
737 AT_DATA([input], [1 50
738 m4_for([x], [1], [50], [1], [@This is cell x in a series of 50.
739 ])])
740 AT_CHECK([render-test input], [0], [dnl
741 +------+------+------+------+------+------+------+------+------+------+------+
742 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
743 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
744 |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9|  cell|  cell|
745 |  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a| 10 in| 11 in|
746 |series|series|series|series|series|series|series|series|series|     a|     a|
747 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|
748 |      |      |      |      |      |      |      |      |      |of 50.|of 50.|
749 +------+------+------+------+------+------+------+------+------+------+------+
750
751 +------+------+------+------+------+------+------+------+------+------+------+
752 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
753 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
754 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
755 | 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in|
756 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
757 |series|series|series|series|series|series|series|series|series|series|series|
758 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
759 +------+------+------+------+------+------+------+------+------+------+------+
760
761 +------+------+------+------+------+------+------+------+------+------+------+
762 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
763 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
764 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
765 | 23 in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in|
766 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
767 |series|series|series|series|series|series|series|series|series|series|series|
768 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
769 +------+------+------+------+------+------+------+------+------+------+------+
770
771 +------+------+------+------+------+------+------+------+------+------+------+
772 |  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
773 |    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
774 |  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
775 | 34 in| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in|
776 |     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
777 |series|series|series|series|series|series|series|series|series|series|series|
778 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
779 +------+------+------+------+------+------+------+------+------+------+------+
780
781 +------+------+------+------+------+------+
782 |  This|  This|  This|  This|  This|  This|
783 |    is|    is|    is|    is|    is|    is|
784 |  cell|  cell|  cell|  cell|  cell|  cell|
785 | 45 in| 46 in| 47 in| 48 in| 49 in| 50 in|
786 |     a|     a|     a|     a|     a|     a|
787 |series|series|series|series|series|series|
788 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
789 +------+------+------+------+------+------+
790 ])
791 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
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 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9|  cell|  cell|
796 |  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a|  in a| 10 in| 11 in|
797 |series|series|series|series|series|series|series|series|series|     a|     a|
798 |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|s
799 |      |      |      |      |      |      |      |      |      |of 50.|of 50.|o
800 +------+------+------+------+------+------+------+------+------+------+------+-
801
802 -----+------+------+------+------+------+------+------+------+------+------+---
803  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  T
804    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
805  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  c
806 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in| 23
807     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
808 eries|series|series|series|series|series|series|series|series|series|series|ser
809 f 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of
810 -----+------+------+------+------+------+------+------+------+------+------+---
811
812 ---+------+------+------+------+------+------+------+------+------+------+-----
813 his|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  Thi
814  is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    i
815 ell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cel
816  in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in| 34 i
817   a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
818 ies|series|series|series|series|series|series|series|series|series|series|serie
819 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50
820 ---+------+------+------+------+------+------+------+------+------+------+-----
821
822 -+------+------+------+------+------+------+------+------+------+------+------+
823 s|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|  This|
824 s|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|    is|
825 l|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|  cell|
826 n| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in| 45 in|
827 a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|     a|
828 s|series|series|series|series|series|series|series|series|series|series|series|
829 .|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|
830 -+------+------+------+------+------+------+------+------+------+------+------+
831
832 +------+------+------+------+------+
833 |  This|  This|  This|  This|  This|
834 |    is|    is|    is|    is|    is|
835 |  cell|  cell|  cell|  cell|  cell|
836 | 46 in| 47 in| 48 in| 49 in| 50 in|
837 |     a|     a|     a|     a|     a|
838 |series|series|series|series|series|
839 |of 50.|of 50.|of 50.|of 50.|of 50.|
840 +------+------+------+------+------+
841 ])
842 AT_CLEANUP
843
844 AT_SETUP([breaking 2 rows of many small cells])
845 AT_KEYWORDS([render rendering])
846 AT_CAPTURE_FILE([input])
847 AT_DATA([input], [2 50
848 m4_for([x], [1], [100], [1], [@x
849 ])])
850 AT_CHECK([render-test input], [0], [dnl
851 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
852 | 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|
853 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
854 |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|
855 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
856
857 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
858 |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50|
859 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
860 |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|
861 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
862 ])
863 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl
864 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
865 | 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|
866 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
867 |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|
868 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
869
870 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
871 |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50|
872 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
873 |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|
874 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+
875 ])
876 AT_CLEANUP
877
878 AT_SETUP([breaking 3 rows with many joined cells])
879 AT_KEYWORDS([render rendering])
880 AT_CAPTURE_FILE([input])
881 AT_DATA([input], [3 49
882 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
883 A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W], [var
884 ])@1
885 m4_for([x], [2], [49], [1], [1*2 @x
886 ])@50
887 ])
888 AT_CHECK([render-test input], [0], [dnl
889  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
890 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
891 |1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20|
892 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
893 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4
894 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
895
896  N O P Q R S T U V  W
897 +---+---+---+---+----+
898 | 21| 22| 23| 24|  25|
899 +-+-+-+-+-+-+-+-+-+--+
900 45| 46| 47| 48| 49|50|
901 --+---+---+---+---+--+
902 ])
903 AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [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 x y z A B C D E F G H I J K L M
905 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
906 |1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20|
907 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
908 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4
909 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
910
911  N O P Q R S T U V  W
912 +---+---+---+---+----+
913 | 21| 22| 23| 24|  25|
914 +-+-+-+-+-+-+-+-+-+--+
915 45| 46| 47| 48| 49|50|
916 --+---+---+---+---+--+
917 ])
918 AT_CLEANUP
919
920 AT_SETUP([horz break 6x6, joined rows and columns])
921 AT_KEYWORDS([render rendering])
922 AT_DATA([input], [WEAVE_6X6])
923 AT_DATA([expout], [dnl
924 +-+--
925 |a|bc
926 +-+-+
927 |j|m|
928 |k+-+
929 |l|t|
930 +-+u|
931 |A|v|
932 +-+-+
933 |IJK|
934 +-+-+
935 |Q|RS
936 +-+--
937
938 --+-+
939 cd|e|
940 +-+-+
941 |nop|
942 +-+-+
943 |w|xy
944 +-+-+
945 |B|E|
946 |C+-+
947 |D|L|
948 +-+M|
949 ST|N|
950 --+-+
951
952 +-+-+
953 |f|i|
954 |g+-+
955 |h|q|
956 +-+r|
957 yz|s|
958 +-+-+
959 |FGH|
960 +-+-+
961 |O|P|
962 +-+-+
963 |U|V|
964 +-+-+
965 ])
966 AT_CHECK([render-test --width=6 input], [0], [expout])
967 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout])
968 AT_CLEANUP
969
970 AT_SETUP([horz break 6x6, joined rows and columns, left header])
971 AT_KEYWORDS([render rendering])
972 AT_DATA([input], [WEAVE_6X6([1 0 0 0])])
973 AT_DATA([expout], [dnl
974 +-+---+-+
975 |a|bcd|e|
976 +-+-+-+-+
977 |j|m|nop|
978 |k+-+-+-+
979 |l|t|w|xy
980 +-+u+-+-+
981 |A|v|B|E|
982 +-+-+C+-+
983 |K K|D|L|
984 +-+-+-+M|
985 |Q|RST|N|
986 +-+---+-+
987
988 +-+-+-+
989 |a|f|i|
990 +-+g+-+
991 |j|h|q|
992 |k+-+r|
993 |l|z|s|
994 +-+-+-+
995 |A|FGH|
996 +-+-+-+
997 |K|O|P|
998 +-+-+-+
999 |Q|U|V|
1000 +-+-+-+
1001 ])
1002 AT_CHECK([render-test --width=10 input], [0], [expout])
1003 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout])
1004 AT_CLEANUP
1005
1006 AT_SETUP([horz break 6x6, joined rows and columns, right header])
1007 AT_KEYWORDS([render rendering])
1008 AT_DATA([input], [WEAVE_6X6([0 1 0 0])])
1009 AT_DATA([expout], [dnl
1010 +-+---+-+
1011 |a|bcd|i|
1012 +-+-+-+-+
1013 |j|m|n|q|
1014 |k+-+-+r|
1015 |l|t|w|s|
1016 +-+u+-+-+
1017 |A|v|B|H|
1018 +-+-+C+-+
1019 |IJK|D|P|
1020 +-+-+-+-+
1021 |Q|RST|V|
1022 +-+---+-+
1023
1024 +-+-+-+
1025 |e|f|i|
1026 +-+g+-+
1027 op|h|q|
1028 +-+-+r|
1029 |xyz|s|
1030 +-+-+-+
1031 |E|H H|
1032 +-+-+-+
1033 |L|O|P|
1034 |M+-+-+
1035 |N|U|V|
1036 +-+-+-+
1037 ])
1038 AT_CHECK([render-test --width=10 input], [0], [expout])
1039 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout])
1040 AT_CLEANUP
1041
1042 AT_SETUP([breaking joined cells too wide for page])
1043 AT_KEYWORDS([render rendering])
1044 AT_DATA([input], [4 6
1045 1*6 @abc def ghi jkl
1046 1*3 @mno pqr
1047 1*3 @stu vwx
1048 1*2 @yzA
1049 1*2 @BCD
1050 1*2 @EFG
1051 @H
1052 @I
1053 @J
1054 @K
1055 @L
1056 @M
1057 ])
1058 AT_CHECK([render-test --width=10 input], [0], [dnl
1059 +--------
1060 |abc def
1061 |
1062 +-----+--
1063 |  mno|
1064 |  pqr|
1065 +---+-+-+
1066 |yzA|BCD|
1067 +-+-+-+-+
1068 |H|I|J|K|
1069 +-+-+-+-+
1070
1071 ----+
1072  ghi|
1073  jkl|
1074 ----+
1075  stu|
1076  vwx|
1077 +---+
1078 |EFG|
1079 +-+-+
1080 |L|M|
1081 +-+-+
1082 ])
1083 AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [dnl
1084 +--------
1085 |abc def
1086 |
1087 +-----+--
1088 |  mno|
1089 |  pqr|
1090 +---+-+-+
1091 |yzA|BCD|
1092 +-+-+-+-+
1093 |H|I|J|K|
1094 +-+-+-+-+
1095
1096 ----+
1097  ghi|
1098  jkl|
1099 ----+
1100  stu|
1101  vwx|
1102 +---+
1103 |EFG|
1104 +-+-+
1105 |L|M|
1106 +-+-+
1107 ])
1108 AT_CLEANUP
1109
1110 AT_SETUP([breaking joined cells much too wide for page])
1111 AT_KEYWORDS([render rendering])
1112 AT_DATA([input], [4 6
1113 1*6 @abc def ghi jkl
1114 1*3 @mno pqr
1115 1*3 @stu vwx
1116 1*2 @yzA
1117 1*2 @BCD
1118 1*2 @EFG
1119 @H
1120 @I
1121 @J
1122 @K
1123 @L
1124 @M
1125 ])
1126 AT_CHECK([render-test --width=6 input], [0], [dnl
1127 +----
1128 |abc
1129 |
1130 +----
1131 |  mn
1132 |  pq
1133 +---+
1134 |yzA|
1135 +-+-+
1136 |H|I|
1137 +-+-+
1138
1139 -----
1140  def
1141
1142 --+--
1143 no|
1144 qr|
1145 +-+-+
1146 |BCD|
1147 +-+-+
1148 |J|K|
1149 +-+-+
1150
1151 ----+
1152  ghi|
1153  jkl|
1154 ----+
1155  stu|
1156  vwx|
1157 +---+
1158 |EFG|
1159 +-+-+
1160 |L|M|
1161 +-+-+
1162 ])
1163 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl
1164 +----
1165 |abc
1166 |
1167 +----
1168 |  mn
1169 |  pq
1170 +---+
1171 |yzA|
1172 +-+-+
1173 |H|I|
1174 +-+-+
1175
1176 -----
1177  def
1178
1179 --+--
1180 no|
1181 qr|
1182 +-+-+
1183 |BCD|
1184 +-+-+
1185 |J|K|
1186 +-+-+
1187
1188 ----+
1189  ghi|
1190  jkl|
1191 ----+
1192  stu|
1193  vwx|
1194 +---+
1195 |EFG|
1196 +-+-+
1197 |L|M|
1198 +-+-+
1199 ])
1200 AT_CLEANUP
1201
1202 AT_SETUP([breaking cell too wide for page, no border])
1203 AT_KEYWORDS([render rendering])
1204 AT_CAPTURE_FILE([input])
1205 AT_DATA([input], [1 1
1206 abcdefghijklmnopqrstuvwxyz
1207 ])
1208 AT_CHECK([render-test --width=6 input], [0], [dnl
1209 abcdef
1210
1211 ghijkl
1212
1213 mnopqr
1214
1215 stuvwx
1216
1217 yz
1218 ])
1219 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl
1220 abcdef
1221
1222 ghijkl
1223
1224 mnopqr
1225
1226 stuvwx
1227
1228 yz
1229 ])
1230 AT_CLEANUP
1231
1232 AT_SETUP([breaking cell too wide for page, with border])
1233 AT_KEYWORDS([render rendering])
1234 AT_CAPTURE_FILE([input])
1235 AT_DATA([input], [1 1
1236 @abcdefghijklmnopqrstuvwxyz
1237 ])
1238 AT_DATA([expout], [dnl
1239 +-----
1240 |abcde
1241 +-----
1242
1243 ------
1244 fghijk
1245 ------
1246
1247 ------
1248 lmnopq
1249 ------
1250
1251 ------
1252 rstuvw
1253 ------
1254
1255 ---+
1256 xyz|
1257 ---+
1258 ])
1259 AT_CHECK([render-test --width=6 input], [0], [expout])
1260 AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout])
1261 AT_CLEANUP
1262
1263 AT_SETUP([horz break 8x8 with many 2x2 joins])
1264 AT_KEYWORDS([render rendering])
1265 AT_DATA([input], [WEAVE_8X8_2])
1266 AT_CHECK([render-test --width=8 input], [0],[dnl
1267 +---+--
1268 |abc|jk
1269 |def|  
1270 |ghi+--
1271 |   |yz
1272 +-+-+BC
1273 |Q|V|EF
1274 |R| |  
1275 |S+-+-+
1276 |T|012|
1277 |U|345|
1278 | |678|
1279 | |   |
1280 +-+-+-+
1281 |xyz|G|
1282 |ABC|H|
1283 |DEF|I|
1284 |   | |
1285 +---+-+
1286 |abcde|
1287 |     |
1288 +-----+
1289
1290 --+----+
1291 kl| mno|
1292   | pqr|
1293 --+ stu|
1294 zA|    |
1295 CD+-+--+
1296 FG|W| Z|
1297   |X|  |
1298 +-+Y+--+
1299 |9| | ab
1300 | | | de
1301 +-+-+ gh
1302 |opq|   
1303 |rst+---
1304 |uvw| JK
1305 |   |   
1306 +---+--+
1307 | MNOPQ|
1308 | RSTUV|
1309 | WXYZ0|
1310 |      |
1311 +------+
1312
1313 +----+
1314 | vwx|
1315 |    |
1316 +----+
1317 | HIJ|
1318 | KLM|
1319 | NOP|
1320 |    |
1321 +-+--+
1322 bc| j|
1323 ef| k|
1324 hi| l|
1325   | m|
1326 --+ n|
1327 KL|  |
1328   |  |
1329 +-+--+
1330 | 123|
1331 | 456|
1332 | 789|
1333 |    |
1334 +----+
1335 ])
1336 AT_CHECK([render-test -o mb0 --min-break=0 --width=8 input], [0],[dnl
1337 +---+--
1338 |abc|jk
1339 |def|  
1340 |ghi+--
1341 |   |yz
1342 +-+-+BC
1343 |Q|V|EF
1344 |R| |  
1345 |S+-+-+
1346 |T|012|
1347 |U|345|
1348 | |678|
1349 | |   |
1350 +-+-+-+
1351 |xyz|G|
1352 |ABC|H|
1353 |DEF|I|
1354 |   | |
1355 +---+-+
1356 |abcde|
1357 |     |
1358 +-----+
1359
1360 --+----+
1361 kl| mno|
1362   | pqr|
1363 --+ stu|
1364 zA|    |
1365 CD+-+--+
1366 FG|W| Z|
1367   |X|  |
1368 +-+Y+--+
1369 |9| | ab
1370 | | | de
1371 +-+-+ gh
1372 |opq|   
1373 |rst+---
1374 |uvw| JK
1375 |   |   
1376 +---+--+
1377 | MNOPQ|
1378 | RSTUV|
1379 | WXYZ0|
1380 |      |
1381 +------+
1382
1383 +----+
1384 | vwx|
1385 |    |
1386 +----+
1387 | HIJ|
1388 | KLM|
1389 | NOP|
1390 |    |
1391 +-+--+
1392 bc| j|
1393 ef| k|
1394 hi| l|
1395   | m|
1396 --+ n|
1397 KL|  |
1398   |  |
1399 +-+--+
1400 | 123|
1401 | 456|
1402 | 789|
1403 |    |
1404 +----+
1405 ])
1406 AT_CLEANUP
1407 \f
1408 AT_BANNER([output rendering -- problematic procedures])
1409
1410 dnl LIST used to put columns right up next to each other without any
1411 dnl intervening space, so this checks for regression.
1412 AT_SETUP([LIST puts space between columns])
1413 AT_KEYWORDS([render rendering])
1414 AT_DATA([list.sps], [dnl
1415 DATA LIST LIST NOTABLE /x y z (F1.0).
1416 BEGIN DATA.
1417 1 2 3
1418 4 5 6
1419 7 8 9
1420 END DATA.
1421 LIST.
1422 ])
1423 AT_CHECK([pspp list.sps], [0], [dnl
1424 Data List
1425 +-+-+-+
1426 |x|y|z|
1427 +-+-+-+
1428 |1|2|3|
1429 |4|5|6|
1430 |7|8|9|
1431 +-+-+-+
1432 ])
1433 AT_CLEANUP
1434
1435 # Long string variables tend to end in lots of spaces.  The ASCII
1436 # driver didn't handle this very well: it would essentially produce
1437 # one blank line in a cell for each trailing space.  This test
1438 # checks for regression.  See bug #38672.
1439 AT_SETUP([ASCII driver renders end of line spaces reasonably])
1440 AT_KEYWORDS([render rendering])
1441 AT_DATA([input], [dnl
1442 3 3
1443 @a
1444 @b
1445 @xyzzy                                          @&t@
1446 @d
1447 @e
1448 @f
1449 @g
1450 @h
1451 @i
1452 ])
1453 AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl
1454 +-+-+-----+
1455 |a|b|xyzzy|
1456 +-+-+-----+
1457 |d|e|    f|
1458 +-+-+-----+
1459 |g|h|    i|
1460 +-+-+-----+
1461 ])
1462 AT_CLEANUP
1463
1464 # There was a bug that, when multiple cells spanned a single column
1465 # (or row), only the dimensions of the cell nearest the bottom of the
1466 # table were actually considered.  This checks for regression.  (This
1467 # problem was most easily observed with SYSFILE INFO, which uses lots
1468 # of spanned cells).
1469 #
1470 # Without the fix, the output looks like this:
1471 # +-------+
1472 # | A long|
1473 # |   text|
1474 # |string.|
1475 # +-------+
1476 # |shorter|
1477 AT_SETUP([multiple spanned cells all contribute to dimensions])
1478 AT_KEYWORDS([render rendering])
1479 AT_DATA([input], [dnl
1480 2 2
1481 1*2 @A long text string.
1482 1*2 @shorter
1483 ])
1484 AT_CHECK([render-test --width=30 --length=15 input], [0], [dnl
1485 +--------------------+
1486 | A long text string.|
1487 +--------------------+
1488 |             shorter|
1489 +--------------------+
1490 ])
1491 AT_CLEANUP