480c83f1b12b48c39225ba938d42b52950ae561d
[pspp] / tests / language / data-io / inpt-pgm.at
1 AT_BANNER([INPUT PROGRAM])
2
3 dnl Tests for a bug which caused a crash when 
4 dnl reading invalid INPUT PROGRAM syntax.
5 AT_SETUP([INPUT PROGRAM invalid syntax crash])
6 AT_DATA([input-program.sps], [dnl
7 INPUT PROGRAM.
8 DATA LIST NOTABLE /a 1-9.
9 BEGIN DATA
10 123456789
11 END DATA.
12 END INPUT PROGRAM.
13 ])
14 AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl
15 input-program.sps:3: error: BEGIN DATA: BEGIN DATA is not allowed inside INPUT PROGRAM.
16 ])
17 AT_CLEANUP
18
19 dnl Tests for bug #21108, 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
23 INPUT PROGRAM.
24 DATA LIST LIST NOTABLE /x.
25 END FILE.
26 END INPUT PROGRAM.
27
28 DESCRIPTIVES x.
29 ])
30 AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl
31 error: DESCRIPTIVES: Syntax error at end of input: expecting BEGIN.
32 ])
33 AT_CLEANUP
34
35 dnl Tests for bug #38782, an infinite loop processing an empty input program.
36 AT_SETUP([INPUT PROGRAM infinite loop])
37 AT_DATA([input-program.sps], [dnl
38 INPUT PROGRAM.
39 STRING firstname lastname (a24) / address (a80).
40 END INPUT PROGRAM.
41 EXECUTE.
42 ])
43 AT_CHECK([pspp -O format=csv input-program.sps], [1], [dnl
44 input-program.sps:3: error: Input program must contain DATA LIST or END FILE.
45
46 input-program.sps:4: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined.
47 ])
48 AT_CLEANUP