render: Don't add overflows when header is contiguous with body.
[pspp] / tests / output / render.at
index 9821348adb62610ed5c77b22f4d20ff50ca04e48..66ae86f7470bbd6083c71fdf7457fa260907c2f2 100644 (file)
@@ -1,3 +1,16 @@
+# +-+---+-+-+-+
+# |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([RENDER_WEAVE_6X6],
   [AT_DATA([input], [6 6 $1
 @a
@@ -26,6 +39,23 @@ m4_define([RENDER_WEAVE_6X6],
 @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([RENDER_8X8],
   [AT_DATA([input], [8 8 $1
 @a
@@ -713,7 +743,7 @@ AT_CHECK([render-test --width=10 input], [0], [dnl
 +-+u+-+-+
 |A|v|B|E|
 +-+-+C+-+
-|K|D|L|
+|IJK|D|L|
 +-+-+-+M|
 |Q|RST|N|
 +-+---+-+
@@ -759,7 +789,7 @@ op|h|q|
 +-+-+r|
 |xyz|s|
 +-+-+-+
-|E|F H|
+|E|FGH|
 +-+-+-+
 |L|O|P|
 |M+-+-+
@@ -1725,12 +1755,11 @@ AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl
 +-+--+--+---+
 |h|       The
 | |        su
-| |    determ
-+-+       han
-|i|missing va
-| |     If IN
-| |         s
-+-+      user
++-+    determ
+|i|       han
+| |missing va
+| |If INCLUDE
++-+ then user
 |j|        va
 | |   include
 | | calculati
@@ -1739,14 +1768,14 @@ AT_CHECK([render-test --width=15 --length=15 input], [0], [dnl
 +-+ NOINCLUDE
 |k|      whic
 | |
-+-+      user
-|l|        va
-| |         e
+| |      user
++-+        va
+|l|         e
+| |
 | |
 +-+
 |m|
 | |
-| |
 +-+----------
 
 +--+--+--+
@@ -1757,8 +1786,7 @@ ubcommand|
 mines the|
 ndling of|
 ariables.|
-NCLUDE is|
-set, then|
+E is set,|
 r‑missing|
 alues are|
 ed in the|
@@ -1804,3 +1832,61 @@ x y z
 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