1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
26 if test "$a" = "1"; then
28 elif test "$a" = " "; then
30 elif test "$b" = "1"; then
32 elif test "$b" = " "; then
34 elif test "$c" = "1"; then
36 elif test "$c" = " "; then
38 elif test "$d" = "1"; then
40 elif test "$d" = " "; then
48 done) >expout 3>do-if.txt || exit 99
49 AT_DATA([do-if.sps], [dnl
50 DATA LIST FILE="do-if.txt"/A B C D 1-4 ABCD 1-4 (A).
52 PRINT OUTFILE="do-if.out"/ABCD 'A'.
54 PRINT OUTFILE="do-if.out"/ABCD 'B'.
56 PRINT OUTFILE="do-if.out"/ABCD 'C'.
58 PRINT OUTFILE="do-if.out"/ABCD 'D'.
60 PRINT OUTFILE="do-if.out"/ABCD 'E'.
64 AT_CHECK([pspp do-if.sps], [0], [ignore])
65 AT_CHECK([cat do-if.out], [0], [expout])
68 AT_SETUP([DO IF - negative])
69 AT_DATA([do-if.sps], [dnl
70 DATA LIST LIST NOTABLE/a b c.
94 AT_CHECK([pspp -O format=csv do-if.sps], [1], [dnl
95 "do-if.sps:6.1-6.6: error: END IF: This command cannot appear outside DO IF...END IF.
99 "do-if.sps:7.1-7.4: error: ELSE: This command cannot appear outside DO IF...END IF.
103 "do-if.sps:8.1-8.7: error: ELSE IF: This command cannot appear outside DO IF...END IF.
107 "do-if.sps:12.1-12.4: error: DO IF: Only one ELSE is allowed within DO IF...END IF.
111 "do-if.sps:11.1-11.5: note: DO IF: This is the location of the previous ELSE clause.
115 "do-if.sps:10.1-10.8: note: DO IF: This is the location of the DO IF command.
119 "do-if.sps:17.1-17.7: error: DO IF: ELSE IF is not allowed following ELSE within DO IF...END IF.
123 "do-if.sps:16.1-16.5: note: DO IF: This is the location of the previous ELSE clause.
127 "do-if.sps:15.1-15.8: note: DO IF: This is the location of the DO IF command.
131 "do-if.sps:20.7: error: DO IF: Syntax error parsing expression.
135 error: DO IF: At end of input: Syntax error expecting END IF.