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