CORRELATIONS: Improve error messages and coding style.
[pspp] / tests / language / stats / correlations.at
index 1662ee7499673dd8e41cee50f081470859932ded..4cb97f32016186917faa552168df5296bf798e36 100644 (file)
@@ -61,9 +61,7 @@ wiz,Pearson Correlation,.890[a],.519,1.000,-.344
 ,Sig. (2-tailed),.017,.291,,.505
 bang,Pearson Correlation,-.308,.118,-.344,1.000
 ,Sig. (2-tailed),.553,.824,.505,
-
-Footnotes:
-a,Significant at .05 level
+Footnote: a. Significant at .05 level
 
 Table: Correlations
 ,,bar,wiz
@@ -86,9 +84,7 @@ wiz,Pearson Correlation,.883[a],.497,1.000,-.337
 bang,Pearson Correlation,-.308,.164,-.337,1.000
 ,Sig. (2-tailed),.553,.725,.460,
 ,N,6,7,7,7
-
-Footnotes:
-a,Significant at .05 level
+Footnote: a. Significant at .05 level
 ]])
 AT_CLEANUP
 
@@ -357,9 +353,7 @@ var2,Pearson Correlation,.3792[a],-.0407
 var3,Pearson Correlation,.3699[a],-.0543
 ,Sig. (2-tailed),.000,.603
 ,N,95,94
-
-Footnotes:
-a,Significant at .05 level
+Footnote: a. Significant at .05 level
 
 Table: Correlations
 ,,var1,var2
@@ -372,9 +366,7 @@ var4,Pearson Correlation,.5693[a],.3792[a]
 var5,Pearson Correlation,-.0519,-.0407
 ,Sig. (2-tailed),.623,.698
 ,N,92,93
-
-Footnotes:
-a,Significant at .05 level
+Footnote: a. Significant at .05 level
 ]])
 
 AT_CLEANUP
@@ -416,3 +408,40 @@ correlations.sps:13: error: CORRELATIONS: The data for the chosen variables are
 ])
 
 AT_CLEANUP
+
+AT_SETUP([CORRELATIONS -- syntax errors])
+AT_DATA([correlations.sps], [dnl
+DATA LIST LIST NOTABLE /x y z.
+CORRELATIONS MISSING=**.
+CORRELATIONS PRINT=**.
+CORRELATIONS STATISTICS=**.
+CORRELATIONS **.
+CORRELATIONS x y z WITH **.
+CORRELATIONS.
+])
+AT_CHECK([pspp -O format=csv correlations.sps], [1], [dnl
+"correlations.sps:2.22-2.23: error: CORRELATIONS: Syntax error expecting PAIRWISE, LISTWISE, INCLUDE, or EXCLUDE.
+    2 | CORRELATIONS MISSING=**.
+      |                      ^~"
+
+"correlations.sps:3.20-3.21: error: CORRELATIONS: Syntax error expecting TWOTAIL, ONETAIL, SIG, or NOSIG.
+    3 | CORRELATIONS PRINT=**.
+      |                    ^~"
+
+"correlations.sps:4.25-4.26: error: CORRELATIONS: Syntax error expecting DESCRIPTIVES, XPROD, or ALL.
+    4 | CORRELATIONS STATISTICS=**.
+      |                         ^~"
+
+"correlations.sps:5.14-5.15: error: CORRELATIONS: Syntax error expecting variable name.
+    5 | CORRELATIONS **.
+      |              ^~"
+
+"correlations.sps:6.25-6.26: error: CORRELATIONS: Syntax error expecting variable name.
+    6 | CORRELATIONS x y z WITH **.
+      |                         ^~"
+
+"correlations.sps:7.1-7.12: error: CORRELATIONS: No variables specified.
+    7 | CORRELATIONS.
+      | ^~~~~~~~~~~~"
+])
+AT_CLEANUP
\ No newline at end of file