DATA LIST FREE: Warn when a quoted string is not followed by a delimiter.
[pspp] / tests / language / stats / npar.at
index 4fa26ecf4749fd71febeff6c63f6cc27ca0d9fa3..f5eb2a404cc803182e338251244afc2eabf67624 100644 (file)
@@ -274,6 +274,28 @@ x,Group1,10.000,10.000,.435,.500,.678
 ])
 AT_CLEANUP
 
+
+
+dnl Test for a bug which caused binomial to crash.
+AT_SETUP([NPAR TESTS BINOMIAL - crash])
+AT_DATA([nparX.sps], [dnl
+data list list /range *.
+begin data.
+0
+1
+end data.
+
+* This is invalid syntax
+NPAR TEST
+       /BINOMIAL(0.5) = Range().
+
+])
+AT_CHECK([pspp -O format=csv nparX.sps], [1], [ignore])
+
+AT_CLEANUP
+
+
+
 AT_SETUP([NPAR TESTS CHISQUARE])
 AT_DATA([npar.sps], [dnl
 DATA LIST NOTABLE LIST /x * y * w *.
@@ -610,9 +632,9 @@ npar tests
        .
 ])
 AT_CHECK([pspp -o pspp.csv npar.sps])
-dnl Some machines return .313 instead of .312 for the Point Probability
+dnl Some machines return .313 instead of .312 
 dnl (see bug #31611).
-AT_CHECK([sed 's/\.313$/.312/' pspp.csv], [0], [dnl
+AT_CHECK([sed -e 's/\.313$/.312/' -e 's/^Exact Sig\. (1-tailed),\.313/Exact Sig. (1-tailed),.312/' pspp.csv], [0], [dnl
 Table: Frequencies
 ,,N
 age - height,Negative Differences,3
@@ -672,8 +694,8 @@ AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Ranks
 ,gv,N,Mean Rank
 xscore,timed out,5,4.400
-,handled the ball,4,11.500
 ,hit wicket,5,7.400
+,handled the ball,4,11.500
 ,Total,14,
 
 Table: Test Statistics
@@ -776,12 +798,12 @@ AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Ranks
 ,gv,N,Mean Rank
 xscore,timed out,5,4.400
-,handled the ball,4,11.500
 ,hit wicket,5,7.400
+,handled the ball,4,11.500
 ,Total,14,
-yscore,handled the ball,4,11.500
+yscore,hit wicket,5,7.400
+,handled the ball,4,11.500
 ,bowled,5,4.400
-,hit wicket,5,7.400
 ,Total,14,
 
 Table: Test Statistics
@@ -1625,3 +1647,41 @@ x,4,24.000,29.500,65.000,15.902,-2.232,.026
 ])
 
 AT_CLEANUP
+
+dnl Checks that (PAIRED) can have lists where the same 
+dnl variable appears more than once.
+AT_SETUP([NPAR TESTS (PAIRED)])
+AT_DATA([npar.sps], [dnl
+set format = F12.3.
+data list notable list /a * b * c *.
+begin data.
+1 2 4
+4 5 3
+1 2 2
+4 5 1
+end data.
+
+npar tests /wilcoxon a b with c c (paired).
+])
+
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
+Table: Ranks
+,,N,Mean Rank,Sum of Ranks
+a - c,Negative Ranks,2,2.500,5.000
+,Positive Ranks,2,2.500,5.000
+,Ties,0,,
+,Total,4,,
+b - c,Negative Ranks,1,1.500,1.500
+,Positive Ranks,2,2.250,4.500
+,Ties,1,,
+,Total,4,,
+
+Table: Test Statistics
+,a - c,b - c
+Z,.000,-.816
+Asymp. Sig. (2-tailed),1.000,.414
+])
+
+
+AT_CLEANUP
+