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