X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Futilities%2Fset.at;h=04ef900c5ea66a62337473463288ef25cc24986a;hb=69b31e124aff05df3492e6e6412c03c64e4e9d12;hp=851642ebdcb36cdc57ecd9a6e8e0eb291c94bb28;hpb=8a0907d063f62c262485b26093ae56450197bb86;p=pspp diff --git a/tests/language/utilities/set.at b/tests/language/utilities/set.at index 851642ebdc..04ef900c5e 100644 --- a/tests/language/utilities/set.at +++ b/tests/language/utilities/set.at @@ -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 . +dnl AT_BANNER([SET]) # This crashed older versions of PSPP (bug #30682). @@ -15,8 +31,148 @@ 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." -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 + + +dnl This scenario was observed to erroneously free things twice +AT_SETUP([SET crash on invalid cc]) +AT_DATA([set.pspp], [dnl +SET CCA='xxxx'.SHGW CCA. +]) + +AT_CHECK([pspp -O format=csv set.pspp], [1], [ignore]) +AT_CLEANUP + + + +AT_SETUP([SET MXWARNS]) +dnl Make sure that syntax processing stops and that +dnl a warning is issued when the MXWARNS figure is +dnl exceeded. +AT_DATA([set.pspp], [dnl +set mxwarns=2. +data list notable list /x (f8.2) y (f8.2). +begin data +1 2 +3 r +5 x +q 8 +9 9 +3 x +w w +end data. + +comment The following line should not be executed. +list. +]) + +AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl +set.pspp:5.3: warning: Data for variable y is not valid as format F: Field contents are not numeric. + +set.pspp:6.3: warning: Data for variable y is not valid as format F: Field contents are not numeric. + +set.pspp:7.1: warning: Data for variable x is not valid as format F: Field contents are not numeric. + +note: Warnings (3) exceed limit (2). Syntax processing will be halted. +]) + +AT_CLEANUP + + + + +AT_SETUP([SET MXWARNS special case zero]) +dnl Make sure that MXWARNS interprets zero as infinity. +AT_DATA([mxwarns.pspp], [dnl +set mxwarns=0. +data list notable list /x (f8.2) y (f8.2) z *. +begin data +1 2 3 +3 r 3 +5 x 3 +q 8 4 +9 9 4 +3 x 4 +w w 4 +end data. + +list. +]) + +AT_CHECK([pspp -O format=csv mxwarns.pspp], [0], +[warning: MXWARNS set to zero. No further warnings will be given even when potentially problematic situations are encountered. + +Table: Data List +x,y,z +1.00,2.00,3.00 +3.00,. ,3.00 +5.00,. ,3.00 +. ,8.00,4.00 +9.00,9.00,4.00 +3.00,. ,4.00 +. ,. ,4.00 +]) + +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 +set-macro.sps:1: note: SHOW: MEXPAND is ON. + +set-macro.sps:1: note: SHOW: MPRINT is OFF. + +set-macro.sps:1: note: SHOW: MITERATE is 1000. + +set-macro.sps:1: note: SHOW: MNEST is 50. + +set-macro.sps:4: note: SHOW: MEXPAND is OFF. + +set-macro.sps:4: note: SHOW: MPRINT is ON. + +set-macro.sps:4: note: SHOW: MITERATE is 10. + +set-macro.sps:4: note: SHOW: MNEST is 11. + +set-macro.sps:6: note: SHOW: MEXPAND is ON. + +set-macro.sps:6: note: SHOW: MPRINT is OFF. + +set-macro.sps:6: note: SHOW: MITERATE is 1000. + +set-macro.sps:6: note: SHOW: MNEST is 50. +]) +AT_CLEANUP + +AT_BANNER([PRESERVE and RESTORE]) + +AT_SETUP([PRESERVE of SET FORMAT]) +AT_DATA([set.pspp], [dnl +SHOW FORMAT. +PRESERVE. +SET FORMAT F10.0. +SHOW FORMAT +RESTORE. +SHOW FORMAT. +]) +AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl +set.pspp:1: note: SHOW: FORMAT is F8.2. + +set.pspp:5: note: SHOW: FORMAT is F10.0. + +set.pspp:6: note: SHOW: FORMAT is F8.2. ]) AT_CLEANUP