Improve error messages for format specifiers.
[pspp] / tests / language / utilities / set.at
index ef31c836c887b397b58448ab7b01c1a7c69a05c6..2103f2e96d5de3bfe24a5daed42f10792170bb27 100644 (file)
@@ -1,3 +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 <http://www.gnu.org/licenses/>.
+dnl
 AT_BANNER([SET])
 
 # This crashed older versions of PSPP (bug #30682).
@@ -13,11 +29,15 @@ SET FORMAT F41.
 DESCRIPTIVES /x.
 ])
 AT_CHECK([pspp -O format=csv set.pspp], [1], [dnl
-"set.pspp:7: error: SET: Output format F41.0 specifies width 41, but F requires a width between 1 and 40."
+"set.pspp:7.12-7.14: error: SET: Output format F41.0 specifies width 41, but F requires a width between 1 and 40.
+    7 | SET FORMAT F41.
+      |            ^~~"
 
-Table: Valid cases = 3; cases with missing value(s) = 0.
-Variable,N,Mean,Std Dev,Minimum,Maximum
+Table: Descriptive Statistics
+,N,Mean,Std Dev,Minimum,Maximum
 x,3,2.00,1.00,1.00,3.00
+Valid N (listwise),3,,,,
+Missing N (listwise),0,,,,
 ])
 AT_CLEANUP
 
@@ -103,8 +123,36 @@ x,y,z
 
 AT_CLEANUP
 
+AT_SETUP([SET macro - MEXPAND MPRINT MITERATE MNEST])
+AT_DATA([set-macro.sps], [dnl
+show mexpand mprint miterate mnest.
+preserve.
+set mexpand=off mprint=on miterate=10 mnest=11.
+show mexpand mprint miterate mnest.
+restore.
+show mexpand mprint miterate mnest.
+])
+AT_CHECK([pspp -O format=csv set-macro.sps], [0], [dnl
+Table: Settings
+MEXPAND,ON
+MPRINT,OFF
+MITERATE,1000
+MNEST,50
+
+Table: Settings
+MEXPAND,OFF
+MPRINT,ON
+MITERATE,10
+MNEST,11
+
+Table: Settings
+MEXPAND,ON
+MPRINT,OFF
+MITERATE,1000
+MNEST,50
+])
+AT_CLEANUP
 \f
-
 AT_BANNER([PRESERVE and RESTORE])
 
 AT_SETUP([PRESERVE of SET FORMAT])
@@ -117,10 +165,13 @@ RESTORE.
 SHOW FORMAT.
 ])
 AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
-set.pspp:1: note: SHOW: FORMAT is F8.2.
+Table: Settings
+FORMAT,F8.2
 
-set.pspp:5: note: SHOW: FORMAT is F10.0.
+Table: Settings
+FORMAT,F10.0
 
-set.pspp:6: note: SHOW: FORMAT is F8.2.
+Table: Settings
+FORMAT,F8.2
 ])
 AT_CLEANUP