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([command parser])
19 dnl Tests for a bug which crashed pspp when given certain invalid input.
20 AT_SETUP([command parser crash bug])
21 AT_DATA([command.sps], [dnl
25 AT_CHECK([pspp -O format=csv command.sps], [1], [dnl
26 command.sps:1: error: Unknown command `DATA rubbish'.
28 command.sps:2: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined.
32 dnl Tests for a bug where FINISH or EXIT wasn't executed until the lexer
33 dnl read the first token of the next command.
35 dnl (If this reecurs, the test will run forever.)
36 AT_SETUP([FINISH executes immediately])
37 AT_CHECK([(echo "FINISH."; while echo ; do true; done) | pspp], [0], [ignore], [ignore])
42 AT_SETUP([ERASE -- safer mode])
43 AT_DATA([foobar], [contents
45 AT_DATA([erase.sps], [dnl
50 AT_CHECK([pspp -O format=csv erase.sps], [1], [dnl
51 erase.sps:3: error: ERASE: This command not allowed when the SAFER option is set.
53 AT_CHECK([cat foobar], [0], [contents
57 AT_SETUP([ERASE -- not safer mode])
58 AT_DATA([foobar], [contents
60 AT_CHECK([test -e foobar])
61 AT_DATA([erase.sps], [dnl
64 AT_CHECK([pspp -O format=csv erase.sps])
65 AT_CHECK([test ! -e foobar])
68 AT_BANNER([N OF CASES])
70 AT_SETUP([N OF CASES])
71 AT_DATA([n-of-cases.sps], [dnl
84 AT_CHECK([pspp -O format=csv n-of-cases.sps], [0], [dnl
107 dnl Tests for a bug wherein a comment just before end-of-file caused an
109 AT_SETUP([COMMENT at end of file])
110 AT_DATA([comment.sps], [dnl
111 COMMENT this is a comment at end of file.
113 AT_CHECK([pspp -O format=csv comment.sps])