Add copyright and licence notices to files which lack them.
[pspp] / tests / language / stats / correlations.at
index 5033f1fedbec94a29eb71490b318152b1cdfb076..1a4c2679db839acec37a4d440b305f40c389522c 100644 (file)
@@ -1,4 +1,19 @@
-AT_BANNER([CORRELATIONS])
+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([CORRELATIONS])
 
 AT_SETUP([CORRELATIONS -- unweighted])
 AT_DATA([correlations.sps], [dnl
@@ -325,26 +340,64 @@ AT_CHECK([pspp -O format=csv  correlations.sps], [0],
 [Table: Correlations
 ,,var4,var5
 var1,Pearson Correlation,.5693,-.0519
-,Sig. (2-tailed),.0000,.6232
+,Sig. (2-tailed),.000,.623
 ,N,93,92
 var2,Pearson Correlation,.3792,-.0407
-,Sig. (2-tailed),.0002,.6985
+,Sig. (2-tailed),.000,.698
 ,N,95,93
 var3,Pearson Correlation,.3699,-.0543
-,Sig. (2-tailed),.0002,.6029
+,Sig. (2-tailed),.000,.603
 ,N,95,94
 
 Table: Correlations
 ,,var1,var2
 var3,Pearson Correlation,.6964,.5615
-,Sig. (2-tailed),.0000,.0000
+,Sig. (2-tailed),.000,.000
 ,N,96,97
 var4,Pearson Correlation,.5693,.3792
-,Sig. (2-tailed),.0000,.0002
+,Sig. (2-tailed),.000,.000
 ,N,93,95
 var5,Pearson Correlation,-.0519,-.0407
-,Sig. (2-tailed),.6232,.6985
+,Sig. (2-tailed),.623,.698
 ,N,92,93
 ])
 
 AT_CLEANUP
+
+
+dnl Crash found by zzuf
+AT_SETUP([CORRELATIONS -- empty dataset])
+
+AT_DATA([correlations.sps], [dnl
+data list list /a b c q g *.
+CORRELATIONS 'VARIABLES = a b.]
+)
+
+AT_CHECK([pspp -o pspp.csv correlations.sps], [1], [ignore])
+
+AT_CLEANUP
+
+dnl Another Crash found by zzuf
+AT_SETUP([CORRELATIONS -- empty dataset 2])
+
+AT_DATA([correlations.sps], [dnl
+data list notable list /foo * bar * wiz bang *.
+begin data.
+ 1     00      3           .
+ 3     9     -50           .
+98    78     104           .
+ .     4       4           .
+ 5     3       0           .
+end data.
+
+correlations
+        variables = foo bar wiz bang
+        /missing = listwise
+        .
+])
+
+AT_CHECK([pspp -O format=csv correlations.sps], [1], [dnl
+correlations.sps:13: error: CORRELATIONS: The data for the chosen variables are all missing or empty.
+])
+
+AT_CLEANUP