X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Foutput%2Frender.at;h=b2c9731ce06ad32d8ae636cb55770e3e4b97b16a;hb=a965acea74a93eba5c78c17c6595eef9a776a464;hp=edbe49ebef4481aba1993106e9df872a44b8bf69;hpb=f86a0b3b5dd8be4fb750db00d829edb8c2a809f2;p=pspp diff --git a/tests/output/render.at b/tests/output/render.at index edbe49ebef..b2c9731ce0 100644 --- a/tests/output/render.at +++ b/tests/output/render.at @@ -1,4 +1,19 @@ -# +-+---+-+-+-+ +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| @@ -11,8 +26,8 @@ # +-+-+-+M+-+-+ # |Q|RST|N|U|V| # +-+---+-+-+-+ -m4_define([RENDER_WEAVE_6X6], - [AT_DATA([input], [6 6 $1 +m4_define([WEAVE_6X6], + [6 6 $1 @a 1*2 @bcd @e @@ -37,7 +52,7 @@ m4_define([RENDER_WEAVE_6X6], 1*2 @RST @U @V -])]) +]) # +-+-+-+-+-+-+-+-+ # |a|b|c|d|e|f|g|h| @@ -56,8 +71,8 @@ m4_define([RENDER_WEAVE_6X6], # +-+-+-+-+-+-+-+-+ # |i|j|k|l|m|n|o|p| # +-+-+-+-+-+-+-+-+ -m4_define([RENDER_8X8], - [AT_DATA([input], [8 8 $1 +m4_define([WEAVE_8X8], + [8 8 $1 @a @b @c @@ -108,7 +123,7 @@ m4_define([RENDER_8X8], @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 @@ -131,8 +146,8 @@ m4_define([RENDER_8X8], # +---+-+RSTUV|456| # |abcde|WXYZ0|789| # +-----+-----+---+ -m4_define([RENDER_8X8_2], - [AT_DATA([input], [8 8 $1 +m4_define([WEAVE_8X8_2], + [8 8 $1 2*2 @abc\ndef\nghi 1*2 @jkl 2*2 @mno\npqr\nstu @@ -154,7 +169,7 @@ m4_define([RENDER_8X8_2], 2*3 @MNOPQ\nRSTUV\nWXYZ0 2*2 @123\n456\n789 1*3 @abcde -])]) +]) AT_BANNER([output rendering -- no page breaking]) @@ -167,6 +182,17 @@ AT_CHECK([render-test input], [0], [abc ]) AT_CLEANUP +AT_SETUP([nested single cell]) +AT_KEYWORDS([render rendering]) +AT_DATA([input], [1 1 +abc +1 1 +{0} +]) +AT_CHECK([render-test input], [0], [abc +]) +AT_CLEANUP + AT_SETUP([single cell with border]) AT_KEYWORDS([render rendering]) AT_DATA([input], [1 1 @@ -179,6 +205,22 @@ AT_CHECK([render-test input], [0], [dnl ]) AT_CLEANUP +AT_SETUP([nested single cell with border]) +AT_KEYWORDS([render rendering]) +AT_DATA([input], [1 1 +@abc +1 1 +@{0} +]) +AT_CHECK([render-test input], [0], [dnl ++-----+ +|+---+| +||abc|| +|+---+| ++-----+ +]) +AT_CLEANUP + AT_SETUP([joined columns]) AT_KEYWORDS([render rendering]) AT_DATA([input], [2 2 @@ -215,9 +257,51 @@ AT_CHECK([render-test input], [0], [dnl ]) 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]) -RENDER_WEAVE_6X6 +AT_DATA([input], [WEAVE_6X6]) AT_CHECK([render-test input], [0], [dnl +-+---+-+-+-+ |a|bcd|e|f|i| @@ -322,6 +406,26 @@ AT_CHECK([render-test input], [0], [dnl ]) AT_CLEANUP +AT_SETUP([nested joined rows]) +AT_KEYWORDS([render rendering]) +AT_DATA([input], [2 2 +2*1 @ab\ncd\nef +@hij +@klm +1 1 +@{0} +]) +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]) @@ -437,7 +541,7 @@ AT_CLEANUP AT_SETUP([8x8 with many 2x2 joins]) AT_KEYWORDS([render rendering]) -RENDER_8X8_2 +AT_DATA([input], [WEAVE_8X8_2]) AT_CHECK([render-test input], [0],[dnl +---+---+----+----+ |abc|jkl| mno| vwx| @@ -463,6 +567,203 @@ AT_CHECK([render-test input], [0],[dnl +-----+------+----+ ]) AT_CLEANUP + +AT_SETUP([nested 8x8]) +AT_KEYWORDS([render rendering]) +AT_DATA([input], [WEAVE_8X8[]dnl +1 1 +@{0} +]) +AT_CHECK([render-test input], [0], [dnl ++-----------------+ +|+-+-+-+-+-+-+-+-+| +||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|| +|+-+-+-+-+-+-+-+-+| ++-----------------+ +]) +AT_CLEANUP + +AT_SETUP([nested 8x8s and 6x6s]) +AT_KEYWORDS([render rendering]) +AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl +4 2 +@{0} +@{1} +@{1} +@|{1} +@|{1} +@({1} +@({1} +@{0} +]) +AT_CHECK([render-test input], [0], [dnl ++-----------------+-----------------+ +|+-+-+-+-+-+-+-+-+| +-+---+-+-+-+| +||a|b|c|d|e|f|g|h|| |a|bcd|e|f|i|| +|+-+-+-+-+-+-+-+-+| +-+-+-+-+g+-+| +||i|jkl|m|nop|q|t|| |j|m|nop|h|q|| +|+-+-+-+-+-+-+r+-+| |k+-+-+-+-+r|| +||u|v|wxy|z|A|s|D|| |l|t|w|xyz|s|| +|+-+-+-+-+-+B+-+-+| +-+u+-+-+-+-+| +||E|F|I|JKL|C|M|P|| |A|v|B|E|FGH|| +|+-+G+-+---+-+N+-+| +-+-+C+-+-+-+| +||Q|H|R|UVW|X|O|Y|| |IJK|D|L|O|P|| +|+-+-+S+-+-+-+-+-+| +-+-+-+M+-+-+| +||Z|0|T|3|456|7|8|| |Q|RST|N|U|V|| +|+-+1+-+-+-+-+-+-+| +-+---+-+-+-+| +||9|2|abc|d|efg|h|| | +|+-+-+-+-+-+-+-+-+| | +||i|j|k|l|m|n|o|p|| | +|+-+-+-+-+-+-+-+-+| | ++-----------------+-----------------+ +| +-+---+-+-+-+| +-+---+-+-+-+ | +| |a|bcd|e|f|i|| |a|bcd|e|f|i| | +| +-+-+-+-+g+-+| +-+-+-+-+g+-+ | +| |j|m|nop|h|q|| |j|m|nop|h|q| | +| |k+-+-+-+-+r|| |k+-+-+-+-+r| | +| |l|t|w|xyz|s|| |l|t|w|xyz|s| | +| +-+u+-+-+-+-+| +-+u+-+-+-+-+ | +| |A|v|B|E|FGH|| |A|v|B|E|FGH| | +| +-+-+C+-+-+-+| +-+-+C+-+-+-+ | +| |IJK|D|L|O|P|| |IJK|D|L|O|P| | +| +-+-+-+M+-+-+| +-+-+-+M+-+-+ | +| |Q|RST|N|U|V|| |Q|RST|N|U|V| | +| +-+---+-+-+-+| +-+---+-+-+-+ | ++-----------------+-----------------+ +| +-+---+-+-+-+ |+-+---+-+-+-+ | +| |a|bcd|e|f|i| ||a|bcd|e|f|i| | +| +-+-+-+-+g+-+ |+-+-+-+-+g+-+ | +| |j|m|nop|h|q| ||j|m|nop|h|q| | +| |k+-+-+-+-+r| ||k+-+-+-+-+r| | +| |l|t|w|xyz|s| ||l|t|w|xyz|s| | +| +-+u+-+-+-+-+ |+-+u+-+-+-+-+ | +| |A|v|B|E|FGH| ||A|v|B|E|FGH| | +| +-+-+C+-+-+-+ |+-+-+C+-+-+-+ | +| |IJK|D|L|O|P| ||IJK|D|L|O|P| | +| +-+-+-+M+-+-+ |+-+-+-+M+-+-+ | +| |Q|RST|N|U|V| ||Q|RST|N|U|V| | +| +-+---+-+-+-+ |+-+---+-+-+-+ | ++-----------------+-----------------+ +|+-+---+-+-+-+ |+-+-+-+-+-+-+-+-+| +||a|bcd|e|f|i| ||a|b|c|d|e|f|g|h|| +|+-+-+-+-+g+-+ |+-+-+-+-+-+-+-+-+| +||j|m|nop|h|q| ||i|jkl|m|nop|q|t|| +||k+-+-+-+-+r| |+-+-+-+-+-+-+r+-+| +||l|t|w|xyz|s| ||u|v|wxy|z|A|s|D|| +|+-+u+-+-+-+-+ |+-+-+-+-+-+B+-+-+| +||A|v|B|E|FGH| ||E|F|I|JKL|C|M|P|| +|+-+-+C+-+-+-+ |+-+G+-+---+-+N+-+| +||IJK|D|L|O|P| ||Q|H|R|UVW|X|O|Y|| +|+-+-+-+M+-+-+ |+-+-+S+-+-+-+-+-+| +||Q|RST|N|U|V| ||Z|0|T|3|456|7|8|| +|+-+---+-+-+-+ |+-+1+-+-+-+-+-+-+| +| ||9|2|abc|d|efg|h|| +| |+-+-+-+-+-+-+-+-+| +| ||i|j|k|l|m|n|o|p|| +| |+-+-+-+-+-+-+-+-+| ++-----------------+-----------------+ +]) +AT_CLEANUP + +AT_SETUP([doubly nested cells]) +AT_KEYWORDS([render rendering]) +AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl +4 2 +@{0} +@{1} +@{1} +@|{1} +@|{1} +@({1} +@({1} +@{0} +1 1 +@{2} +]) +AT_CHECK([render-test input --length=70], [0], [dnl ++-------------------------------------+ +|+-----------------+-----------------+| +||+-+-+-+-+-+-+-+-+| +-+---+-+-+-+|| +|||a|b|c|d|e|f|g|h|| |a|bcd|e|f|i||| +||+-+-+-+-+-+-+-+-+| +-+-+-+-+g+-+|| +|||i|jkl|m|nop|q|t|| |j|m|nop|h|q||| +||+-+-+-+-+-+-+r+-+| |k+-+-+-+-+r||| +|||u|v|wxy|z|A|s|D|| |l|t|w|xyz|s||| +||+-+-+-+-+-+B+-+-+| +-+u+-+-+-+-+|| +|||E|F|I|JKL|C|M|P|| |A|v|B|E|FGH||| +||+-+G+-+---+-+N+-+| +-+-+C+-+-+-+|| +|||Q|H|R|UVW|X|O|Y|| |IJK|D|L|O|P||| +||+-+-+S+-+-+-+-+-+| +-+-+-+M+-+-+|| +|||Z|0|T|3|456|7|8|| |Q|RST|N|U|V||| +||+-+1+-+-+-+-+-+-+| +-+---+-+-+-+|| +|||9|2|abc|d|efg|h|| || +||+-+-+-+-+-+-+-+-+| || +|||i|j|k|l|m|n|o|p|| || +||+-+-+-+-+-+-+-+-+| || +|+-----------------+-----------------+| +|| +-+---+-+-+-+| +-+---+-+-+-+ || +|| |a|bcd|e|f|i|| |a|bcd|e|f|i| || +|| +-+-+-+-+g+-+| +-+-+-+-+g+-+ || +|| |j|m|nop|h|q|| |j|m|nop|h|q| || +|| |k+-+-+-+-+r|| |k+-+-+-+-+r| || +|| |l|t|w|xyz|s|| |l|t|w|xyz|s| || +|| +-+u+-+-+-+-+| +-+u+-+-+-+-+ || +|| |A|v|B|E|FGH|| |A|v|B|E|FGH| || +|| +-+-+C+-+-+-+| +-+-+C+-+-+-+ || +|| |IJK|D|L|O|P|| |IJK|D|L|O|P| || +|| +-+-+-+M+-+-+| +-+-+-+M+-+-+ || +|| |Q|RST|N|U|V|| |Q|RST|N|U|V| || +|| +-+---+-+-+-+| +-+---+-+-+-+ || +|+-----------------+-----------------+| +|| +-+---+-+-+-+ |+-+---+-+-+-+ || +|| |a|bcd|e|f|i| ||a|bcd|e|f|i| || +|| +-+-+-+-+g+-+ |+-+-+-+-+g+-+ || +|| |j|m|nop|h|q| ||j|m|nop|h|q| || +|| |k+-+-+-+-+r| ||k+-+-+-+-+r| || +|| |l|t|w|xyz|s| ||l|t|w|xyz|s| || +|| +-+u+-+-+-+-+ |+-+u+-+-+-+-+ || +|| |A|v|B|E|FGH| ||A|v|B|E|FGH| || +|| +-+-+C+-+-+-+ |+-+-+C+-+-+-+ || +|| |IJK|D|L|O|P| ||IJK|D|L|O|P| || +|| +-+-+-+M+-+-+ |+-+-+-+M+-+-+ || +|| |Q|RST|N|U|V| ||Q|RST|N|U|V| || +|| +-+---+-+-+-+ |+-+---+-+-+-+ || +|+-----------------+-----------------+| +||+-+---+-+-+-+ |+-+-+-+-+-+-+-+-+|| +|||a|bcd|e|f|i| ||a|b|c|d|e|f|g|h||| +||+-+-+-+-+g+-+ |+-+-+-+-+-+-+-+-+|| +|||j|m|nop|h|q| ||i|jkl|m|nop|q|t||| +|||k+-+-+-+-+r| |+-+-+-+-+-+-+r+-+|| +|||l|t|w|xyz|s| ||u|v|wxy|z|A|s|D||| +||+-+u+-+-+-+-+ |+-+-+-+-+-+B+-+-+|| +|||A|v|B|E|FGH| ||E|F|I|JKL|C|M|P||| +||+-+-+C+-+-+-+ |+-+G+-+---+-+N+-+|| +|||IJK|D|L|O|P| ||Q|H|R|UVW|X|O|Y||| +||+-+-+-+M+-+-+ |+-+-+S+-+-+-+-+-+|| +|||Q|RST|N|U|V| ||Z|0|T|3|456|7|8||| +||+-+---+-+-+-+ |+-+1+-+-+-+-+-+-+|| +|| ||9|2|abc|d|efg|h||| +|| |+-+-+-+-+-+-+-+-+|| +|| ||i|j|k|l|m|n|o|p||| +|| |+-+-+-+-+-+-+-+-+|| +|+-----------------+-----------------+| ++-------------------------------------+ +]) +AT_CLEANUP AT_BANNER([output rendering -- horizontal page breaks]) @@ -827,7 +1128,7 @@ AT_CLEANUP AT_SETUP([horz break 6x6, joined rows and columns]) AT_KEYWORDS([render rendering]) -RENDER_WEAVE_6X6 +AT_DATA([input], [WEAVE_6X6]) AT_DATA([expout], [dnl +-+-- |a|bc @@ -877,7 +1178,7 @@ AT_CLEANUP AT_SETUP([horz break 6x6, joined rows and columns, left header]) AT_KEYWORDS([render rendering]) -RENDER_WEAVE_6X6([1 0 0 0]) +AT_DATA([input], [WEAVE_6X6([1 0 0 0])]) AT_DATA([expout], [dnl +-+---+-+ |a|bcd|e| @@ -913,7 +1214,7 @@ AT_CLEANUP AT_SETUP([horz break 6x6, joined rows and columns, right header]) AT_KEYWORDS([render rendering]) -RENDER_WEAVE_6X6([0 1 0 0]) +AT_DATA([input], [WEAVE_6X6([0 1 0 0])]) AT_DATA([expout], [dnl +-+---+-+ |a|bcd|i| @@ -1170,7 +1471,7 @@ AT_CLEANUP AT_SETUP([horz break 8x8 with many 2x2 joins]) AT_KEYWORDS([render rendering]) -RENDER_8X8_2 +AT_DATA([input], [WEAVE_8X8_2]) AT_CHECK([render-test --width=8 input], [0],[dnl +---+-- |abc|jk @@ -1921,7 +2222,7 @@ AT_CLEANUP AT_SETUP([vert break 6x6, joined rows and columns]) AT_KEYWORDS([render rendering]) -RENDER_WEAVE_6X6 +AT_DATA([input], [WEAVE_6X6]) AT_CHECK([render-test --length=6 input], [0], [dnl +-+---+-+-+-+ |a|bcd|e|f|i| @@ -2091,12 +2392,44 @@ AT_CHECK([render-test --width=7 --length=6 input], [0], [expout]) AT_CHECK([render-test -o mb0 --min-break=0 --width=7 --length=6 input], [0], [expout]) AT_CLEANUP + +AT_SETUP([breaking nested cell too tall for page]) +AT_KEYWORDS([render rendering]) +AT_CAPTURE_FILE([input]) +AT_DATA([input], [WEAVE_8X8[]WEAVE_6X6[]dnl +1 2 +@{0} +@{1} +]) +AT_CHECK([render-test input --length=10], [0], [dnl ++-----------------+-------------+ +|+-+-+-+-+-+-+-+-+|+-+---+-+-+-+| +||a|b|c|d|e|f|g|h|||a|bcd|e|f|i|| +|+-+-+-+-+-+-+-+-+|+-+-+-+-+g+-+| +||i|jkl|m|nop|q|t|||j|m|nop|h|q|| +|+-+-+-+-+-+-+r+-+||k+-+-+-+-+r|| +||u|v|wxy|z|A|s|D|||l|t|w|xyz|s|| +|+-+-+-+-+-+B+-+-+|+-+u+-+-+-+-+| +||E|F|I|JKL|C|M|P|||A|v|B|E|FGH|| +|+-+G+-+---+-+N+-+|+-+-+C+-+-+-+| + +||Q|H|R|UVW|X|O|Y|||IJK|D|L|O|P|| +|+-+-+S+-+-+-+-+-+|+-+-+-+M+-+-+| +||Z|0|T|3|456|7|8|||Q|RST|N|U|V|| +|+-+1+-+-+-+-+-+-+|+-+---+-+-+-+| +||9|2|abc|d|efg|h|| | +|+-+-+-+-+-+-+-+-+| | +||i|j|k|l|m|n|o|p|| | +|+-+-+-+-+-+-+-+-+| | ++-----------------+-------------+ +]) +AT_CLEANUP AT_BANNER([output rendering -- double page breaks]) AT_SETUP([double break 6x6, joined rows and columns]) AT_KEYWORDS([render rendering]) -RENDER_WEAVE_6X6 +AT_DATA([input], [WEAVE_6X6]) AT_CHECK([render-test --width=6 --length=6 input], [0], [dnl +-+-- |a|bc @@ -2211,7 +2544,7 @@ AT_CLEANUP AT_SETUP([double break 8x8, with joins, left and right headers]) AT_KEYWORDS([render rendering]) -RENDER_8X8([1 1 0 0]) +AT_DATA([input], [WEAVE_8X8([1 1 0 0])]) AT_CHECK([render-test input --width=14 --length=14], [0], [dnl +-+-+-+-+-+-+ |a|b|c|d|e|h| @@ -2298,7 +2631,7 @@ AT_CLEANUP AT_SETUP([double break 8x8, with joins, top and bottom headers]) AT_KEYWORDS([render rendering]) -RENDER_8X8([0 0 1 1]) +AT_DATA([input], [WEAVE_8X8([0 0 1 1])]) AT_CHECK([render-test input --width=14 --length=14], [0], [dnl +-+-+-+-+-+-+ |a|b|c|d|e|f| @@ -2405,7 +2738,7 @@ AT_CLEANUP AT_SETUP([double break 8x8, with joins, all headers]) AT_KEYWORDS([render rendering]) -RENDER_8X8([1 1 1 1]) +AT_DATA([input], [WEAVE_8X8([1 1 1 1])]) AT_CHECK([render-test input --width=14 --length=14], [0], [dnl +-+-+-+-+-+-+ |a|b|c|d|e|h|