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
12
-
1 -2 @&t@
-
-
3 4 @&t@
34
-
3 -4 @&t@
-
-
. 6 @&t@
.6
-
. -6 @&t@
-
-
7 . @&t@
7.
-
7 -. @&t@
-
-
9 0 @&t@
90
-
9 -0 @&t@
-
])
AT_CLEANUP
LIST.
])
AT_CHECK([pspp -O format=csv print.sps], [1], [dnl
-print.sps:7.7-7.10: error: PRINT: Syntax error at `F8.2': expecting a valid subcommand.
+"print.sps:7.7-7.10: error: PRINT: Syntax error expecting OUTFILE, ENCODING, RECORDS, TABLE, or NOTABLE.
+ 7 | PRINT F8.2
+ | ^~~~"
Table: Data List
a,b
5 R
])
AT_CLEANUP
+
+AT_SETUP([PRINT syntax errors])
+AT_DATA([print.sps], [dnl
+DATA LIST LIST NOTABLE /x.
+PRINT OUTFILE=**.
+PRINT ENCODING=**.
+PRINT RECORDS=-1.
+PRINT **.
+PRINT/ **.
+PRINT/'string' 0.
+PRINT/'string' 5-3.
+PRINT/y.
+PRINT/x 0.
+PRINT/x (A8).
+])
+AT_CHECK([pspp -O format=csv print.sps], [1], [dnl
+"print.sps:2.15-2.16: error: PRINT: Syntax error expecting a file name or handle name.
+ 2 | PRINT OUTFILE=**.
+ | ^~"
+
+"print.sps:3.16-3.17: error: PRINT: Syntax error expecting string.
+ 3 | PRINT ENCODING=**.
+ | ^~"
+
+"print.sps:4.15-4.16: error: PRINT: Syntax error expecting non-negative integer for RECORDS.
+ 4 | PRINT RECORDS=-1.
+ | ^~"
+
+"print.sps:5.7-5.8: error: PRINT: Syntax error expecting OUTFILE, ENCODING, RECORDS, TABLE, or NOTABLE.
+ 5 | PRINT **.
+ | ^~"
+
+"print.sps:6.8-6.9: error: PRINT: Syntax error expecting variable name.
+ 6 | PRINT/ **.
+ | ^~"
+
+"print.sps:7.16: error: PRINT: Column positions for fields must be positive.
+ 7 | PRINT/'string' 0.
+ | ^"
+
+"print.sps:8.16-8.18: error: PRINT: The ending column for a field must be greater than the starting column.
+ 8 | PRINT/'string' 5-3.
+ | ^~~"
+
+"print.sps:9.7: error: PRINT: y is not a variable name.
+ 9 | PRINT/y.
+ | ^"
+
+"print.sps:10.9: error: PRINT: Column positions for fields must be positive.
+ 10 | PRINT/x 0.
+ | ^"
+
+"print.sps:11.9-11.12: error: PRINT: Numeric variable x is not compatible with string format A8.
+ 11 | PRINT/x (A8).
+ | ^~~~"
+])
+AT_CLEANUP