improve error messages for scale variable summaries
[pspp] / tests / language / stats / ctables.at
index 0eb8760a585a1ce2ed893c7974e8e8be49ac408e..e9ab6d2187b71615d3277e603be8b328bdc42e25 100644 (file)
@@ -648,6 +648,11 @@ variable must be specified.
 
 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
 
+ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
+summary.
+   23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
+      |                                                  ^~~~~
+
 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
 summary.
    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
@@ -658,10 +663,10 @@ summary.
    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
       |                                 ^~~~~
 
-ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
-summary.
+ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
+has a summary even if the syntax does not explicitly specify one.
    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
-      |                                                  ^~~~~
+      |                                 ^~~~~
 ]])
 AT_CLEANUP
 
@@ -2529,3 +2534,14 @@ s&../../..&MM/DD/YY&'], [0], [dnl
 Generated HH:MM:SS on MM/DD/YY
 ])
 AT_CLEANUP
+
+AT_SETUP([CTABLES summary functions])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+CTABLES
+    /TABLE region > qnd5 + qnd6_1 BY qnd7a + agegroup BY qns3a[COUNT, ROWPCT, COLPCT, SUBTABLEPCT]
+    /SLABELS POSITION=ROW.
+]])
+AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [])
+AT_CLEANUP