render: Add comments to tests.
[pspp] / tests / output / render.at
index 902a5b6be6072bf1b0cd9f3de6d4c3162465acb9..721c2cd481da2699d0160e74528c243c7d65753a 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
@@ -292,6 +322,36 @@ AT_CHECK([render-test input], [0], [dnl
 ])
 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
@@ -348,7 +408,7 @@ 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.
+@PSPP includes special support\nfor unknown numeric data values.\nMissing observations are assigned\na special value, called the\n``systemmissing 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
 +----------------------------------------------------------+------------------+
@@ -362,7 +422,7 @@ AT_CHECK([render-test input], [0], [dnl
 |                                                          |          assigned|
 |                                                          |  a special value,|
 |                                                          |        called the|
-|                                                          |  ``system-missing|
+|                                                          |  ``systemmissing|
 |                                                          |    value''.  This|
 |                                                          |``value'' actually|
 |                                                          |     indicates the|
@@ -1682,7 +1742,7 @@ AT_DATA([input], [7 7
 @f
 @g
 @h
-6*6 @The MISSING subcommand determines the handling of missing variables.  If INCLUDE is set, then user-missing values are included in the calculations.  If NOINCLUDE is set, which is the default, user-missing values are excluded.
+6*6 @The MISSING subcommand determines the handling of missing variables.  If INCLUDE is set, then user‑missing values are included in the calculations.  If NOINCLUDE is set, which is the default, user‑missing values are excluded.
 @i
 @j
 @k
@@ -1695,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
@@ -1709,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|
 | |
-| |
 +-+----------
 
 +--+--+--+
@@ -1727,9 +1786,8 @@ ubcommand|
 mines the|
 ndling of|
 ariables.|
-NCLUDE is|
-set, then|
-r-missing|
+E is set,|
+r‑missing|
 alues are|
 ed in the|
 ions.  If|
@@ -1738,7 +1796,7 @@ E is set,|
 E is set,|
 ch is the|
  default,|
-r-missing|
+rmissing|
 alues are|
 excluded.|
          |
@@ -1749,3 +1807,86 @@ excluded.|
 ---------+
 ])
 AT_CLEANUP
+\f
+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