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/>.
17 AT_BANNER([INPUT PROGRAM])
19 dnl Tests for a bug which caused a crash when
20 dnl reading invalid INPUT PROGRAM syntax.
21 AT_SETUP([INPUT PROGRAM invalid syntax crash])
22 AT_DATA([input-program.sps], [dnl
24 DATA LIST NOTABLE /a 1-9.
30 AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl
31 input-program.sps:3: error: BEGIN DATA: BEGIN DATA is not allowed inside INPUT PROGRAM.
35 dnl Tests for bug #21108, a crash when
36 dnl reading invalid INPUT PROGRAM syntax.
37 AT_SETUP([INPUT PROGRAM invalid syntax crash])
38 AT_DATA([input-program.sps], [dnl
40 DATA LIST LIST NOTABLE /x.
46 AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl
47 error: DESCRIPTIVES: Syntax error at end of input: expecting BEGIN.
51 dnl Tests for bug #38782, an infinite loop processing an empty input program.
52 AT_SETUP([INPUT PROGRAM infinite loop])
53 AT_DATA([input-program.sps], [dnl
55 STRING firstname lastname (a24) / address (a80).
59 AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl
60 input-program.sps:3: error: INPUT PROGRAM: Input program must contain DATA LIST or END FILE.
62 input-program.sps:4: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined.
66 dnl Tests for bug #39097, a bug when an INPUT PROGRAM used VECTOR, was
67 dnl followed immediately by a call to proc_execute() (here via DATASET
68 dnl COPY), and then the input was actually used.
69 AT_SETUP([INPUT PROGRAM with VECTOR and EXECUTE])
70 AT_DATA([input-program.sps], [dnl
84 AT_CHECK([pspp -O format=csv input-program.sps], [0], [dnl
86 vec1,vec2,vec3,vec4,vec5
87 1.00,2.00,3.00,4.00,5.00
88 1.00,2.00,3.00,4.00,5.00
89 1.00,2.00,3.00,4.00,5.00
90 1.00,2.00,3.00,4.00,5.00
91 1.00,2.00,3.00,4.00,5.00
92 1.00,2.00,3.00,4.00,5.00
93 1.00,2.00,3.00,4.00,5.00
94 1.00,2.00,3.00,4.00,5.00
95 1.00,2.00,3.00,4.00,5.00
96 1.00,2.00,3.00,4.00,5.00