MEANS: Improve error messages and coding style.
[pspp] / tests / language / stats / means.at
index 72f98b3d1ff8718bccab8d517c55ee58ca9bac2b..f25fe04aec0a38f3b2c42c52deea94bbc89be3ef 100644 (file)
@@ -1120,5 +1120,34 @@ Range,02:01:00,$1.14
 
 AT_CLEANUP
 
-
-
+AT_SETUP([MEANS syntax errors])
+AT_DATA([means.sps], [dnl
+DATA LIST LIST NOTABLE/x y z.
+MEANS TABLES **.
+MEANS x BY **.
+MEANS x/MISSING=**.
+MEANS x/CELLS=**.
+MEANS x/ **.
+])
+AT_CHECK([pspp -O format=csv means.sps], [1], [dnl
+"means.sps:2.14-2.15: error: MEANS: Syntax error expecting `='.
+    2 | MEANS TABLES **.
+      |              ^~"
+
+"means.sps:3.12-3.13: error: MEANS: Syntax error expecting variable name.
+    3 | MEANS x BY **.
+      |            ^~"
+
+"means.sps:4.17-4.18: error: MEANS: Syntax error expecting INCLUDE or DEPENDENT.
+    4 | MEANS x/MISSING=**.
+      |                 ^~"
+
+"means.sps:5.15-5.16: error: MEANS: Syntax error expecting one of the following: MEAN, COUNT, STDDEV, SEMEAN, SUM, MIN, MAX, RANGE, VARIANCE, KURT, SEKURT, SKEW, SESKEW, FIRST, LAST, HARMONIC, GEOMETRIC.
+    5 | MEANS x/CELLS=**.
+      |               ^~"
+
+"means.sps:6.10-6.11: error: MEANS: Syntax error expecting MISSING or CELLS.
+    6 | MEANS x/ **.
+      |          ^~"
+])
+AT_CLEANUP
\ No newline at end of file