X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=tests%2Flanguage%2Fstats%2Fexamine.at;h=6ccfac555a7d150a2d4e5f95d806c65bb3e1f361;hb=5dbf5abcbed01f04422d4dead1c0ae0bb7efde4f;hp=54307f4688732abb85c445ae6deb8498d6e254f1;hpb=130edcbf2974767a7550b47c1933670e5302bd96;p=pspp diff --git a/tests/language/stats/examine.at b/tests/language/stats/examine.at index 54307f4688..6ccfac555a 100644 --- a/tests/language/stats/examine.at +++ b/tests/language/stats/examine.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([EXAMINE]) AT_SETUP([EXAMINE]) @@ -615,7 +631,12 @@ BEGIN DATA. . END DATA. -EXAMINE /x PLOT=HISTOGRAM. +EXAMINE /x + PLOT=HISTOGRAM BOXPLOT NPPLOT SPREADLEVEL(1) ALL + /ID=x + /STATISTICS = DESCRIPTIVES EXTREME (5) ALL + /PERCENTILE=AEMPIRICAL + . ]) AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore]) dnl Ignore output -- this is just a no-crash check. @@ -1018,3 +1039,95 @@ X,Mean,,587.6603,23.2665 ]) AT_CLEANUP + + + +dnl Test for a crash which happened on bad input syntax +AT_SETUP([EXAMINE -- Empty Parentheses]) + +AT_DATA([examine-empty-parens.sps], [dnl +DATA LIST notable LIST /X * +BEGIN DATA. +2 +3 +END DATA. + + +EXAMINE + x + /PLOT = SPREADLEVEL() + . +]) + +AT_CHECK([pspp -o pspp.csv examine-empty-parens.sps], [1], [ignore]) + +AT_CLEANUP + + + + +dnl Test for another crash which happened on bad input syntax +AT_SETUP([EXAMINE -- Bad variable]) + +AT_DATA([examine-bad-variable.sps], [dnl +data list list /h * g *. +begin data. +3 1 +4 1 +5 2 +end data. + +EXAMINE + /VARIABLES/ h + BY g + . +]) + +AT_CHECK([pspp -o pspp.csv examine-bad-variable.sps], [1], [ignore]) + +AT_CLEANUP + + + +dnl Test for yet another crash. This time for extremes vs. missing weight values. +AT_SETUP([EXAMINE -- Extremes vs. Missing Weights]) + +AT_DATA([examine-missing-weights.sps], [dnl +data list notable list /h * g *. +begin data. +3 1 +4 . +5 1 +2 1 +end data. + +WEIGHT BY g. + +EXAMINE h + /STATISTICS extreme(3) + . +]) + +AT_CHECK([pspp -O format=csv examine-missing-weights.sps], [0], [dnl +"examine-missing-weights.sps:13: warning: EXAMINE: At least one case in the data file had a weight value that was user-missing, system-missing, zero, or negative. These case(s) were ignored." + +Table: Case Processing Summary +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +h,3.00,100%,.00,0%,3.00,100% + +Table: Extreme Values +,,,Case Number,Value +h,Highest,1,3,5.00 +,,2,2,4.00 +,,3,1,3.00 +,Lowest,1,4,2.00 +,,2,1,3.00 +,,3,2,4.00 +]) + +AT_CLEANUP + + +