dnl PSPP - a program for statistical analysis. dnl Copyright (C) 2017 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation, either version 3 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . dnl # +-+---+-+-+-+ # |a|bcd|e|f|i| # +-+-+-+-+g+-+ # |j|m|nop|h|q| # |k+-+-+-+-+r| # |l|t|w|xyz|s| # +-+u+-+-+-+-+ # |A|v|B|E|FGH| # +-+-+C+-+-+-+ # |IJK|D|L|O|P| # +-+-+-+M+-+-+ # |Q|RST|N|U|V| # +-+---+-+-+-+ m4_define([WEAVE_6X6], [6 6 $1 @a 1*2 @bcd @e 2*1 @f\ng\nh @i 2*1 @j\nk\nl @m 1*2 @nop 2*1 @q\nr\ns 2*1 @t\nu\nv @w 1*2 @xyz @A 2*1 @B\nC\nD @E 1*2 @FGH 1*2 @IJK 2*1 @L\nM\nN @O @P @Q 1*2 @RST @U @V ]) # +-+-+-+-+-+-+-+-+ # |a|b|c|d|e|f|g|h| # +-+-+-+-+-+-+-+-+ # |i|jkl|m|nop|q|t| # +-+-+-+-+-+-+r+-+ # |u|v|wxy|z|A|s|D| # +-+-+-+-+-+B+-+-+ # |E|F|I|JKL|C|M|P| # +-+G+-+---+-+N+-+ # |Q|H|R|UVW|X|O|Y| # +-+-+S+-+-+-+-+-+ # |Z|0|T|3|456|7|8| # +-+1+-+-+-+-+-+-+ # |9|2|abc|d|efg|h| # +-+-+-+-+-+-+-+-+ # |i|j|k|l|m|n|o|p| # +-+-+-+-+-+-+-+-+ m4_define([WEAVE_8X8], [8 8 $1 @a @b @c @d @e @f @g @h @i 1*2 @jkl @m 1*2 @nop 2*1 @q\nr\ns @t @u @v 1*2 @wxy @z 2*1 @A\nB\nC @D @E 2*1 @F\nG\nH @I 1*2 @JKL 2*1 @M\nN\nO @P @Q 2*1 @R\nS\nT 1*2 @UVW @X @Y @Z 2*1 @0\n1\n2 @3 1*2 @456 @7 @8 @9 1*2 @abc @d 1*2 @efg @h @i @j @k @l @m @n @o @p ]) # This input is something of a counterexample, in that it could render # compactly as this if the algorithm for choosing cell widths and # heights were smarter: # # +---+---+---+-+-+ # |abc|jkl|mno|v|x| # |def+---+pqr+-+-+ # |ghi|yzA|stu|HIJ| # +-+-+BCD+-+-+KLM| # |Q|V|EFG|W|Z|NOP| # |R+-+-+-+X+-+-+-+ # |S|012|9|Y|abc|j| # |T|345+-+-+def|k| # |U|678|opq|ghi|l| # +-+-+-+rst+---+m| # |xyz|G|uvw|JKL|n| # |ABC|H+---+-+-+-+ # |DEF|I|MNOPQ|123| # +---+-+RSTUV|456| # |abcde|WXYZ0|789| # +-----+-----+---+ m4_define([WEAVE_8X8_2], [8 8 $1 2*2 @abc\ndef\nghi 1*2 @jkl 2*2 @mno\npqr\nstu 1*2 @vwx 2*2 @yzA\nBCD\nEFG 2*2 @HIJ\nKLM\nNOP 3*1 @Q\nR\nS\nT\nU @V 2*1 @W\nX\nY @Z 2*2 @012\n345\n678 @9 2*2 @abc\ndef\nghi 3*1 @j\nk\nl\nm\nn 2*2 @opq\nrst\nuvw 2*2 @xyz\nABC\nDEF 2*1 @G\nH\nI 1*2 @JKL 2*3 @MNOPQ\nRSTUV\nWXYZ0 2*2 @123\n456\n789 1*3 @abcde ]) AT_BANNER([output rendering -- no page breaking]) AT_SETUP([single cell]) AT_KEYWORDS([render rendering]) AT_DATA([input], [1 1 abc ]) AT_CHECK([render-test input], [0], [abc ]) AT_CLEANUP AT_SETUP([single cell with border]) AT_KEYWORDS([render rendering]) AT_DATA([input], [1 1 @abc ]) AT_CHECK([render-test input], [0], [dnl +---+ |abc| +---+ ]) AT_CLEANUP AT_SETUP([joined columns]) AT_KEYWORDS([render rendering]) AT_DATA([input], [2 2 1*2 @abcdefg @hij @klm ]) AT_CHECK([render-test input], [0], [dnl +-------+ |abcdefg| +---+---+ |hij|klm| +---+---+ ]) AT_CLEANUP AT_SETUP([3x3, joined rows and columns]) AT_KEYWORDS([render rendering]) AT_DATA([input], [3 3 1*2 @abc 2*1 @d\ne\nf 2*1 @g\nh\ni @j 1*2 @klm ]) AT_CHECK([render-test input], [0], [dnl +---+-+ |abc|d| +-+-+e| |g|j|f| |h+-+-+ |i|klm| +-+---+ ]) AT_CLEANUP AT_SETUP([joined rows and columns (with footnotes)]) AT_KEYWORDS([render rendering footnote]) AT_DATA([input], [3 3 1*2 @abc#Approximation. 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. 2*1 @g\nh\ni#One#Two#Three @j 1*2 @klm ]) AT_CHECK([render-test --csv input], [0], [[+------------+----+ | abc[a]| d| +----------+-+ e| | g|j|f[b]| | h+-+----+ |i[c][d][e]| klm| +----------+------+ a. Approximation. 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. c. One d. Two e. Three ]]) AT_CHECK([cat render.csv], [0], [[abc[a],,"d e f[b]" "g h i[c][d][e]",j, ,klm, Footnotes: a,Approximation. 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. c,One d,Two e,Three ]]) AT_CLEANUP AT_SETUP([6x6, joined rows and columns]) AT_KEYWORDS([render rendering]) AT_DATA([input], [WEAVE_6X6]) AT_CHECK([render-test input], [0], [dnl +-+---+-+-+-+ |a|bcd|e|f|i| +-+-+-+-+g+-+ |j|m|nop|h|q| |k+-+-+-+-+r| |l|t|w|xyz|s| +-+u+-+-+-+-+ |A|v|B|E|FGH| +-+-+C+-+-+-+ |IJK|D|L|O|P| +-+-+-+M+-+-+ |Q|RST|N|U|V| +-+---+-+-+-+ ]) AT_CLEANUP AT_SETUP([3 rows with many joined cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [3 19 m4_foreach([x], [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s], [x ])@1 m4_for([x], [2], [19], [1], [1*2 @x ])@20 ]) AT_CHECK([render-test input], [0], [dnl a b c d e f g h i j k l m n o p q r s +-+---+---+---+---+---+---+---+---+----+ |1| 2| 3| 4| 5| 6| 7| 8| 9| 10| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+ | 11| 12| 13| 14| 15| 16| 17| 18| 19|20| +---+---+---+---+---+---+---+---+---+--+ ]) AT_CLEANUP AT_SETUP([3 columns with many joined cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [19 3 a @1 2*1 @11\nab\ncd b 2*1 @2\nab\ncd c 2*1 @12\nab\ncd d 2*1 @3\nab\ncd e 2*1 @13\nab\ncd f 2*1 @4\nab\ncd g 2*1 @14\nab\ncd h 2*1 @5\nab\ncd i 2*1 @15\nab\ncd j 2*1 @6\nab\ncd k 2*1 @16\nab\ncd l 2*1 @7\nab\ncd m 2*1 @17\nab\ncd n 2*1 @8\nab\ncd o 2*1 @18\nab\ncd p 2*1 @9\nab\ncd q 2*1 @19\nab\ncd r 2*1 @10\nab\ncd s @20 ]) AT_CHECK([render-test input], [0], [dnl +--+--+ a| 1|11| +--+ab| b| 2|cd| |ab+--+ c|cd|12| +--+ab| d| 3|cd| |ab+--+ e|cd|13| +--+ab| f| 4|cd| |ab+--+ g|cd|14| +--+ab| h| 5|cd| |ab+--+ i|cd|15| +--+ab| j| 6|cd| |ab+--+ k|cd|16| +--+ab| l| 7|cd| |ab+--+ m|cd|17| +--+ab| n| 8|cd| |ab+--+ o|cd|18| +--+ab| p| 9|cd| |ab+--+ q|cd|19| +--+ab| r|10|cd| |ab+--+ s|cd|20| +--+--+ ]) AT_CLEANUP AT_SETUP([joined rows]) AT_KEYWORDS([render rendering]) AT_DATA([input], [2 2 2*1 @ab\ncd\nef @hij @klm ]) AT_CHECK([render-test input], [0], [dnl +--+---+ |ab|hij| |cd+---+ |ef|klm| +--+---+ ]) AT_CLEANUP dnl This checks for bug #31346, a segmentation fault that surfaced dnl when two or more rows had no unspanned cells and no rules. AT_SETUP([joined rows only, no rules]) AT_KEYWORDS([render rendering]) AT_DATA([input], [2 2 2*1 ab\ncd\nef 2*1 hij\nklm\nnop ]) AT_CHECK([render-test input], [0], [dnl ab hij cd klm ef nop ]) AT_CLEANUP AT_SETUP([joined columns only, no rules]) AT_KEYWORDS([render rendering]) AT_DATA([input], [2 2 1*2 abc\ndef 1*2 hij\nklm\nnop ]) AT_CHECK([render-test input], [0], [dnl abc def hij klm nop ]) AT_CLEANUP AT_SETUP([5 big narrow cells]) AT_KEYWORDS([render rendering]) AT_DATA([input], [1 5 @This cell has a lot of text but its minimum width is pretty narrow. @This cell also has a lot of text but its minimum width is pretty narrow. @A third cell with a lot of text but a pretty narrow minimum width. @A fourth cell with a lot of text but a pretty narrow minimum width. @A fifth cell with a lot of text but a pretty narrow minimum width. ]) AT_CHECK([render-test input], [0], [dnl +---------------+---------------+--------------+---------------+--------------+ |This cell has a| This cell also| A third cell| A fourth cell| A fifth cell| |lot of text but| has a lot of| with a lot of| with a lot of| with a lot of| | its minimum| text but its| text but a| text but a| text but a| |width is pretty| minimum width| pretty narrow| pretty narrow| pretty narrow| | narrow.| is pretty|minimum width.| minimum width.|minimum width.| | | narrow.| | | | +---------------+---------------+--------------+---------------+--------------+ ]) AT_CLEANUP AT_SETUP([9 big narrow cells]) AT_KEYWORDS([render rendering]) AT_DATA([input], [1 9 @This cell has a lot of text but its minimum width is pretty narrow. @This cell also has a lot of text but its minimum width is pretty narrow. @A third cell with a lot of text but a pretty narrow minimum width. @A fourth cell with a lot of text but a pretty narrow minimum width. @A fifth cell with a lot of text but a pretty narrow minimum width. @A sixth cell with a lot of text but a pretty narrow minimum width. @A seventh cell with a lot of text but a pretty narrow minimum width. @A eighth cell with a lot of text but a pretty narrow minimum width. @A ninth cell with a lot of text but a pretty narrow minimum width. ]) AT_CHECK([render-test input], [0], [dnl +--------+-------+--------+--------+-------+--------+--------+-------+--------+ | This| This| A third|A fourth|A fifth| A sixth| A| A| A ninth| |cell has| cell| cell| cell| cell| cell| seventh| eighth| cell| |a lot of| also| with a| with a| with a| with a| cell| cell| with a| |text but| has a| lot of| lot of| lot of| lot of| with a| with a| lot of| | its| lot of|text but|text but| text|text but| lot of| lot of|text but| | minimum| text|a pretty|a pretty| but a|a pretty|text but| text|a pretty| |width is|but its| narrow| narrow| pretty| narrow|a pretty| but a| narrow| | pretty|minimum| minimum| minimum| narrow| minimum| narrow| pretty| minimum| | narrow.| width| width.| width.|minimum| width.| minimum| narrow| width.| | | is| | | width.| | width.|minimum| | | | pretty| | | | | | width.| | | |narrow.| | | | | | | | +--------+-------+--------+--------+-------+--------+--------+-------+--------+ ]) AT_CLEANUP AT_SETUP([2 big cells with new-lines]) AT_KEYWORDS([render rendering]) AT_DATA([input], [1 2 @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. @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. ]) AT_CHECK([render-test input], [0], [dnl +----------------------------------------------------------+------------------+ | PSPP does not place many restrictions on ordering of| PSPP includes| | commands. The main restriction is that variables must be| special support| | defined before they are otherwise referenced. This| for unknown| | section describes the details of command ordering, but| numeric data| | most users will have no need to refer to them. PSPP| values.| | possesses five internal states, called initial, INPUT| Missing| | PROGRAM, FILE TYPE, transformation, and procedure states.| observations are| | | assigned| | | a special value,| | | called the| | | ``system‑missing| | | value''. This| | |``value'' actually| | | indicates the| | | absence of a| | | value; it| | | means that the| | | actual| | | value is unknown.| +----------------------------------------------------------+------------------+ ]) AT_CLEANUP AT_SETUP([8x8 with many 2x2 joins]) AT_KEYWORDS([render rendering]) AT_DATA([input], [WEAVE_8X8_2]) AT_CHECK([render-test input], [0],[dnl +---+---+----+----+ |abc|jkl| mno| vwx| |def| | pqr| | |ghi+---+ stu+----+ | |yzA| | HIJ| +-+-+BCD+-+--+ KLM| |Q|V|EFG|W| Z| NOP| |R| | |X| | | |S+-+-+-+Y+--+-+--+ |T|012|9| | abc| j| |U|345| | | def| k| | |678+-+-+ ghi| l| | | |opq| | m| +-+-+-+rst+----+ n| |xyz|G|uvw| JKL| | |ABC|H| | | | |DEF|I+---+--+-+--+ | | | MNOPQ| 123| +---+-+ RSTUV| 456| |abcde| WXYZ0| 789| | | | | +-----+------+----+ ]) AT_CLEANUP AT_BANNER([output rendering -- horizontal page breaks]) AT_SETUP([breaking row of many small cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 50 m4_for([x], [1], [50], [1], [@x ])]) AT_CHECK([render-test input], [0], [dnl +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ ]) AT_CHECK([render-test input -o mb0 --min-break=0], [0], [dnl +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ ]) AT_CLEANUP AT_SETUP([breaking row of many small cells, with headers]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 54 2 2 @ha @hb m4_for([x], [1], [50], [1], [@x ])dnl @hc @hd ]) AT_CHECK([render-test input], [0], [dnl +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+ |ha|hb|48|49|50|hc|hd| +--+--+--+--+--+--+--+ ]) AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +--+--+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+ |ha|hb|48|49|50|hc|hd| +--+--+--+--+--+--+--+ ]) AT_CLEANUP AT_SETUP([breaking row of many medium-size cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 50 m4_for([x], [1], [50], [1], [@cell x ])]) AT_CHECK([render-test input], [0], [dnl +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell| | 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell| | 16| 17| 18| 19| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 30| +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell| | 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 45| +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+ |cell|cell|cell|cell|cell| | 46| 47| 48| 49| 50| +----+----+----+----+----+ ]) AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- |cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cel | 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 1 +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-- l|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce 6| 17| 18| 19| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 30| 31| -+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-- --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+- ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|c 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 45| 46| 47| --+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+- ---+----+----+ ell|cell|cell| 48| 49| 50| ---+----+----+ ]) AT_CLEANUP AT_SETUP([breaking row of many medium-size cells, with headers]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 52 1 1 header1 m4_for([x], [1], [50], [1], [@cell x ])dnl header2 ]) AT_CHECK([render-test input], [0], [dnl +----+----+----+----+----+----+----+----+----+----+----+----+ header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2 | 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| +----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+----+----+ header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2 | 13| 14| 15| 16| 17| 18| 19| 20| 21| 22| 23| 24| +----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+----+----+ header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2 | 25| 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| +----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+----+----+ header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2 | 37| 38| 39| 40| 41| 42| 43| 44| 45| 46| 47| 48| +----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+ header1|cell|cell|header2 | 49| 50| +----+----+ ]) AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl +----+----+----+----+----+----+----+----+----+----+----+----+--+ header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2 | 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| | +----+----+----+----+----+----+----+----+----+----+----+----+--+ +--+----+----+----+----+----+----+----+----+----+----+----+----+ header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2 |13| 14| 15| 16| 17| 18| 19| 20| 21| 22| 23| 24| 25| +--+----+----+----+----+----+----+----+----+----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+----+----+--+ header1|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|ce|header2 | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| | +----+----+----+----+----+----+----+----+----+----+----+----+--+ +--+----+----+----+----+----+----+----+----+----+----+----+----+ header1|ll|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|cell|header2 |38| 39| 40| 41| 42| 43| 44| 45| 46| 47| 48| 49| 50| +--+----+----+----+----+----+----+----+----+----+----+----+----+ ]) AT_CLEANUP AT_SETUP([breaking row of many big narrow cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 50 m4_for([x], [1], [50], [1], [@This is cell x in a series of 50. ])]) AT_CHECK([render-test input], [0], [dnl +------+------+------+------+------+------+------+------+------+------+------+ | This| This| This| This| This| This| This| This| This| This| This| | is| is| is| is| is| is| is| is| is| is| is| |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9| cell| cell| | in a| in a| in a| in a| in a| in a| in a| in a| in a| 10 in| 11 in| |series|series|series|series|series|series|series|series|series| a| a| |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series| | | | | | | | | | |of 50.|of 50.| +------+------+------+------+------+------+------+------+------+------+------+ +------+------+------+------+------+------+------+------+------+------+------+ | This| This| This| This| This| This| This| This| This| This| This| | is| is| is| is| is| is| is| is| is| is| is| | cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| | 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in| | a| a| a| a| a| a| a| a| a| a| a| |series|series|series|series|series|series|series|series|series|series|series| |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.| +------+------+------+------+------+------+------+------+------+------+------+ +------+------+------+------+------+------+------+------+------+------+------+ | This| This| This| This| This| This| This| This| This| This| This| | is| is| is| is| is| is| is| is| is| is| is| | cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| | 23 in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in| | a| a| a| a| a| a| a| a| a| a| a| |series|series|series|series|series|series|series|series|series|series|series| |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.| +------+------+------+------+------+------+------+------+------+------+------+ +------+------+------+------+------+------+------+------+------+------+------+ | This| This| This| This| This| This| This| This| This| This| This| | is| is| is| is| is| is| is| is| is| is| is| | cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| | 34 in| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in| | a| a| a| a| a| a| a| a| a| a| a| |series|series|series|series|series|series|series|series|series|series|series| |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.| +------+------+------+------+------+------+------+------+------+------+------+ +------+------+------+------+------+------+ | This| This| This| This| This| This| | is| is| is| is| is| is| | cell| cell| cell| cell| cell| cell| | 45 in| 46 in| 47 in| 48 in| 49 in| 50 in| | a| a| a| a| a| a| |series|series|series|series|series|series| |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.| +------+------+------+------+------+------+ ]) AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl +------+------+------+------+------+------+------+------+------+------+------+- | This| This| This| This| This| This| This| This| This| This| This| | is| is| is| is| is| is| is| is| is| is| is| |cell 1|cell 2|cell 3|cell 4|cell 5|cell 6|cell 7|cell 8|cell 9| cell| cell| | in a| in a| in a| in a| in a| in a| in a| in a| in a| 10 in| 11 in| |series|series|series|series|series|series|series|series|series| a| a| |of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|series|series|s | | | | | | | | | |of 50.|of 50.|o +------+------+------+------+------+------+------+------+------+------+------+- -----+------+------+------+------+------+------+------+------+------+------+--- This| This| This| This| This| This| This| This| This| This| This| T is| is| is| is| is| is| is| is| is| is| is| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| c 12 in| 13 in| 14 in| 15 in| 16 in| 17 in| 18 in| 19 in| 20 in| 21 in| 22 in| 23 a| a| a| a| a| a| a| a| a| a| a| eries|series|series|series|series|series|series|series|series|series|series|ser f 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of -----+------+------+------+------+------+------+------+------+------+------+--- ---+------+------+------+------+------+------+------+------+------+------+----- his| This| This| This| This| This| This| This| This| This| This| Thi is| is| is| is| is| is| is| is| is| is| is| i ell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cel in| 24 in| 25 in| 26 in| 27 in| 28 in| 29 in| 30 in| 31 in| 32 in| 33 in| 34 i a| a| a| a| a| a| a| a| a| a| a| ies|series|series|series|series|series|series|series|series|series|series|serie 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50 ---+------+------+------+------+------+------+------+------+------+------+----- -+------+------+------+------+------+------+------+------+------+------+------+ s| This| This| This| This| This| This| This| This| This| This| This| s| is| is| is| is| is| is| is| is| is| is| is| l| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| cell| n| 35 in| 36 in| 37 in| 38 in| 39 in| 40 in| 41 in| 42 in| 43 in| 44 in| 45 in| a| a| a| a| a| a| a| a| a| a| a| a| s|series|series|series|series|series|series|series|series|series|series|series| .|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.|of 50.| -+------+------+------+------+------+------+------+------+------+------+------+ +------+------+------+------+------+ | This| This| This| This| This| | is| is| is| is| is| | cell| cell| cell| cell| cell| | 46 in| 47 in| 48 in| 49 in| 50 in| | a| a| a| a| a| |series|series|series|series|series| |of 50.|of 50.|of 50.|of 50.|of 50.| +------+------+------+------+------+ ]) AT_CLEANUP AT_SETUP([breaking 2 rows of many small cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [2 50 m4_for([x], [1], [100], [1], [@x ])]) AT_CHECK([render-test input], [0], [dnl +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 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| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+ |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+ |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+ ]) AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 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| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |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| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+ |27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49| 50| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+ |77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---+ ]) AT_CLEANUP AT_SETUP([breaking 3 rows with many joined cells]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [3 49 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 A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W], [var ])@1 m4_for([x], [2], [49], [1], [1*2 @x ])@50 ]) AT_CHECK([render-test input], [0], [dnl 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 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ |1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-- N O P Q R S T U V W +---+---+---+---+----+ | 21| 22| 23| 24| 25| +-+-+-+-+-+-+-+-+-+--+ 45| 46| 47| 48| 49|50| --+---+---+---+---+--+ ]) AT_CHECK([render-test -o mb0 --min-break=0 input], [0], [dnl 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 +-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ |1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 26| 27| 28| 29| 30| 31| 32| 33| 34| 35| 36| 37| 38| 39| 40| 41| 42| 43| 44| 4 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-- N O P Q R S T U V W +---+---+---+---+----+ | 21| 22| 23| 24| 25| +-+-+-+-+-+-+-+-+-+--+ 45| 46| 47| 48| 49|50| --+---+---+---+---+--+ ]) AT_CLEANUP AT_SETUP([horz break 6x6, joined rows and columns]) AT_KEYWORDS([render rendering]) AT_DATA([input], [WEAVE_6X6]) AT_DATA([expout], [dnl +-+-- |a|bc +-+-+ |j|m| |k+-+ |l|t| +-+u| |A|v| +-+-+ |IJK| +-+-+ |Q|RS +-+-- --+-+ cd|e| +-+-+ |nop| +-+-+ |w|xy +-+-+ |B|E| |C+-+ |D|L| +-+M| ST|N| --+-+ +-+-+ |f|i| |g+-+ |h|q| +-+r| yz|s| +-+-+ |FGH| +-+-+ |O|P| +-+-+ |U|V| +-+-+ ]) AT_CHECK([render-test --width=6 input], [0], [expout]) AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout]) AT_CLEANUP AT_SETUP([horz break 6x6, joined rows and columns, left header]) AT_KEYWORDS([render rendering]) AT_DATA([input], [WEAVE_6X6([1 0 0 0])]) AT_DATA([expout], [dnl +-+---+-+ |a|bcd|e| +-+-+-+-+ |j|m|nop| |k+-+-+-+ |l|t|w|xy +-+u+-+-+ |A|v|B|E| +-+-+C+-+ |IJK|D|L| +-+-+-+M| |Q|RST|N| +-+---+-+ +-+-+-+ |a|f|i| +-+g+-+ |j|h|q| |k+-+r| |l|z|s| +-+-+-+ |A|FGH| +-+-+-+ |K|O|P| +-+-+-+ |Q|U|V| +-+-+-+ ]) AT_CHECK([render-test --width=10 input], [0], [expout]) AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout]) AT_CLEANUP AT_SETUP([horz break 6x6, joined rows and columns, right header]) AT_KEYWORDS([render rendering]) AT_DATA([input], [WEAVE_6X6([0 1 0 0])]) AT_DATA([expout], [dnl +-+---+-+ |a|bcd|i| +-+-+-+-+ |j|m|n|q| |k+-+-+r| |l|t|w|s| +-+u+-+-+ |A|v|B|H| +-+-+C+-+ |IJK|D|P| +-+-+-+-+ |Q|RST|V| +-+---+-+ +-+-+-+ |e|f|i| +-+g+-+ op|h|q| +-+-+r| |xyz|s| +-+-+-+ |E|FGH| +-+-+-+ |L|O|P| |M+-+-+ |N|U|V| +-+-+-+ ]) AT_CHECK([render-test --width=10 input], [0], [expout]) AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [expout]) AT_CLEANUP AT_SETUP([breaking joined cells too wide for page]) AT_KEYWORDS([render rendering]) AT_DATA([input], [4 6 1*6 @abc def ghi jkl 1*3 @mno pqr 1*3 @stu vwx 1*2 @yzA 1*2 @BCD 1*2 @EFG @H @I @J @K @L @M ]) AT_CHECK([render-test --width=10 input], [0], [dnl +-------- |abc def | +-----+-- | mno| | pqr| +---+-+-+ |yzA|BCD| +-+-+-+-+ |H|I|J|K| +-+-+-+-+ ----+ ghi| jkl| ----+ stu| vwx| +---+ |EFG| +-+-+ |L|M| +-+-+ ]) AT_CHECK([render-test -o mb0 --min-break=0 --width=10 input], [0], [dnl +-------- |abc def | +-----+-- | mno| | pqr| +---+-+-+ |yzA|BCD| +-+-+-+-+ |H|I|J|K| +-+-+-+-+ ----+ ghi| jkl| ----+ stu| vwx| +---+ |EFG| +-+-+ |L|M| +-+-+ ]) AT_CLEANUP AT_SETUP([breaking joined cells much too wide for page]) AT_KEYWORDS([render rendering]) AT_DATA([input], [4 6 1*6 @abc def ghi jkl 1*3 @mno pqr 1*3 @stu vwx 1*2 @yzA 1*2 @BCD 1*2 @EFG @H @I @J @K @L @M ]) AT_CHECK([render-test --width=6 input], [0], [dnl +---- |abc | +---- | mn | pq +---+ |yzA| +-+-+ |H|I| +-+-+ ----- def --+-- no| qr| +-+-+ |BCD| +-+-+ |J|K| +-+-+ ----+ ghi| jkl| ----+ stu| vwx| +---+ |EFG| +-+-+ |L|M| +-+-+ ]) AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl +---- |abc | +---- | mn | pq +---+ |yzA| +-+-+ |H|I| +-+-+ ----- def --+-- no| qr| +-+-+ |BCD| +-+-+ |J|K| +-+-+ ----+ ghi| jkl| ----+ stu| vwx| +---+ |EFG| +-+-+ |L|M| +-+-+ ]) AT_CLEANUP AT_SETUP([breaking cell too wide for page, no border]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 1 abcdefghijklmnopqrstuvwxyz ]) AT_CHECK([render-test --width=6 input], [0], [dnl abcdef ghijkl mnopqr stuvwx yz ]) AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [dnl abcdef ghijkl mnopqr stuvwx yz ]) AT_CLEANUP AT_SETUP([breaking cell too wide for page, with border]) AT_KEYWORDS([render rendering]) AT_CAPTURE_FILE([input]) AT_DATA([input], [1 1 @abcdefghijklmnopqrstuvwxyz ]) AT_DATA([expout], [dnl +----- |abcde +----- ------ fghijk ------ ------ lmnopq ------ ------ rstuvw ------ ---+ xyz| ---+ ]) AT_CHECK([render-test --width=6 input], [0], [expout]) AT_CHECK([render-test -o mb0 --min-break=0 --width=6 input], [0], [expout]) AT_CLEANUP AT_SETUP([horz break 8x8 with many 2x2 joins]) AT_KEYWORDS([render rendering]) AT_DATA([input], [WEAVE_8X8_2]) AT_CHECK([render-test --width=8 input], [0],[dnl +---+-- |abc|jk |def| |ghi+-- | |yz +-+-+BC |Q|V|EF |R| | |S+-+-+ |T|012| |U|345| | |678| | | | +-+-+-+ |xyz|G| |ABC|H| |DEF|I| | | | +---+-+ |abcde| | | +-----+ --+----+ kl| mno| | pqr| --+ stu| zA| | CD+-+--+ FG|W| Z| |X| | +-+Y+--+ |9| | ab | | | de +-+-+ gh |opq| |rst+--- |uvw| JK | | +---+--+ | MNOPQ| | RSTUV| | WXYZ0| | | +------+ +----+ | vwx| | | +----+ | HIJ| | KLM| | NOP| | | +-+--+ bc| j| ef| k| hi| l| | m| --+ n| KL| | | | +-+--+ | 123| | 456| | 789| | | +----+ ]) AT_CHECK([render-test -o mb0 --min-break=0 --width=8 input], [0],[dnl +---+-- |abc|jk |def| |ghi+-- | |yz +-+-+BC |Q|V|EF |R| | |S+-+-+ |T|012| |U|345| | |678| | | | +-+-+-+ |xyz|G| |ABC|H| |DEF|I| | | | +---+-+ |abcde| | | +-----+ --+----+ kl| mno| | pqr| --+ stu| zA| | CD+-+--+ FG|W| Z| |X| | +-+Y+--+ |9| | ab | | | de +-+-+ gh |opq| |rst+--- |uvw| JK | | +---+--+ | MNOPQ| | RSTUV| | WXYZ0| | | +------+ +----+ | vwx| | | +----+ | HIJ| | KLM| | NOP| | | +-+--+ bc| j| ef| k| hi| l| | m| --+ n| KL| | | | +-+--+ | 123| | 456| | 789| | | +----+ ]) AT_CLEANUP AT_BANNER([output rendering -- problematic procedures]) dnl LIST used to put columns right up next to each other without any dnl intervening space, so this checks for regression. AT_SETUP([LIST puts space between columns]) AT_KEYWORDS([render rendering]) AT_DATA([list.sps], [dnl DATA LIST LIST NOTABLE /x y z (F1.0). BEGIN DATA. 1 2 3 4 5 6 7 8 9 END DATA. LIST. ]) AT_CHECK([pspp list.sps], [0], [dnl Data List +-+-+-+ |x|y|z| +-+-+-+ |1|2|3| |4|5|6| |7|8|9| +-+-+-+ ]) AT_CLEANUP # Long string variables tend to end in lots of spaces. The ASCII # driver didn't handle this very well: it would essentially produce # one blank line in a cell for each trailing space. This test # checks for regression. See bug #38672. AT_SETUP([ASCII driver renders end of line spaces reasonably]) AT_KEYWORDS([render rendering]) AT_DATA([input], [dnl 3 3 @a @b @xyzzy @&t@ @d @e @f @g @h @i ]) AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl +-+-+-----+ |a|b|xyzzy| +-+-+-----+ |d|e| f| +-+-+-----+ |g|h| i| +-+-+-----+ ]) AT_CLEANUP # There was a bug that, when multiple cells spanned a single column # (or row), only the dimensions of the cell nearest the bottom of the # table were actually considered. This checks for regression. (This # problem was most easily observed with SYSFILE INFO, which uses lots # of spanned cells). # # Without the fix, the output looks like this: # +-------+ # | A long| # | text| # |string.| # +-------+ # |shorter| AT_SETUP([multiple spanned cells all contribute to dimensions]) AT_KEYWORDS([render rendering]) AT_DATA([input], [dnl 2 2 1*2 @A long text string. 1*2 @shorter ]) AT_CHECK([render-test --width=30 --length=15 input], [0], [dnl +--------------------+ | A long text string.| +--------------------+ | shorter| +--------------------+ ]) AT_CLEANUP