MATRIX: Improve error messages.
[pspp] / tests / language / data-io / data-list.at
index 5bfdb497b1f60b4fc4fa708ccfa28b2e1698f066..b20fd35b7b43870e7e8999f5d1bf215fb1e88161 100644 (file)
@@ -1,16 +1,16 @@
 dnl PSPP - a program for statistical analysis.
 dnl Copyright (C) 2017 Free Software Foundation, Inc.
-dnl 
+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
 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
 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
@@ -349,8 +349,8 @@ data-list.sps:4: warning: Missing delimiter following quoted string.
 
 Table: Data List
 s
-y         @&t@
-z         @&t@
+y
+z
 ])
 AT_CLEANUP
 
@@ -402,34 +402,33 @@ Case Number,A
 AT_CLEANUP
 
 
-AT_SETUP([DATA LIST - Negative SKIP])
+AT_SETUP([DATA LIST syntax errors])
+AT_DATA([insert.sps], [dnl
+INSERT FILE='data-list.sps' ERROR=IGNORE.
+])
 AT_DATA([data-list.sps], [dnl
 DATA LIST LIST FILE='f.in' NOTABLE SKIP=-1 /a b c d.
-
-EXECUTE.
-])
-
-AT_CHECK([pspp -O format=csv data-list.sps], [1], [dnl
-data-list.sps:1: error: DATA LIST: The SKIP value must be nonnegative.
-
-data-list.sps:3: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+DATA LIST LIST FILE='f.in' NOTABLE RECORDS=-1 /a b c d.
+DATA LIST FIXED FILE='f.in' NOTABLE/a (F8.0, F9.0).
+DATA LIST FIXED FILE='f.in' NOTABLE/a b 1-3.
 ])
 
-AT_CLEANUP
-
-
-AT_SETUP([DATA LIST - Negative RECORDS])
-AT_DATA([data-list.sps], [dnl
-DATA LIST LIST FILE='f.in' NOTABLE RECORDS=-1 /a b c d.
+AT_CHECK([pspp --testing-mode -O format=csv insert.sps], [1], [dnl
+"data-list.sps:1.41-1.42: error: DATA LIST: Syntax error expecting non-negative integer for SKIP.
+    1 | DATA LIST LIST FILE='f.in' NOTABLE SKIP=-1 /a b c d.
+      |                                         ^~"
 
-EXECUTE.
-])
+"data-list.sps:2.44-2.45: error: DATA LIST: Syntax error expecting non-negative integer for RECORDS.
+    2 | DATA LIST LIST FILE='f.in' NOTABLE RECORDS=-1 /a b c d.
+      |                                            ^~"
 
-AT_CHECK([pspp -O format=csv data-list.sps], [1], [dnl
-data-list.sps:1: error: DATA LIST: The RECORDS value must be nonnegative.
+"data-list.sps:3.40-3.50: error: DATA LIST: Number of variables specified (1) differs from number of variable formats (2).
+    3 | DATA LIST FIXED FILE='f.in' NOTABLE/a (F8.0, F9.0).
+      |                                        ^~~~~~~~~~~"
 
-data-list.sps:3: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+"data-list.sps:4.41-4.43: error: DATA LIST: The 3 columns 1-3 can't be evenly divided into 2 fields.
+    4 | DATA LIST FIXED FILE='f.in' NOTABLE/a b 1-3.
+      |                                         ^~~"
 ])
 
 AT_CLEANUP
-