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/>.
16 dnl AT_BANNER([command parser])
18 dnl Tests for a bug which crashed pspp when given certain invalid input.
19 AT_SETUP([command parser crash bug])
20 AT_DATA([command.sps], [dnl
24 AT_CHECK([pspp -O format=csv command.sps], [1], [dnl
25 command.sps:1: error: Unknown command `DATA rubbish'.
27 command.sps:2: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined.
31 dnl Tests for a bug where FINISH or EXIT wasn't executed until the lexer
32 dnl read the first token of the next command.
34 dnl (If this reecurs, the the test will run forever.)
35 AT_SETUP([FINISH executes immediately])
36 AT_CHECK([(echo "FINISH."; while echo ; do true; done) | pspp], [0], [ignore], [ignore])
41 AT_SETUP([ERASE -- safer mode])
42 AT_DATA([foobar], [contents
44 AT_DATA([erase.sps], [dnl
49 AT_CHECK([pspp -O format=csv erase.sps], [1], [dnl
50 erase.sps:3: error: ERASE: This command not allowed when the SAFER option is set.
52 AT_CHECK([cat foobar], [0], [contents
56 AT_SETUP([ERASE -- not safer mode])
57 AT_DATA([foobar], [contents
59 AT_CHECK([test -e foobar])
60 AT_DATA([erase.sps], [dnl
63 AT_CHECK([pspp -O format=csv erase.sps])
64 AT_CHECK([test ! -e foobar])
67 AT_BANNER([N OF CASES])
69 AT_SETUP([N OF CASES])
70 AT_DATA([n-of-cases.sps], [dnl
83 AT_CHECK([pspp -O format=csv n-of-cases.sps], [0], [dnl
106 dnl Tests for a bug wherein a comment just before end-of-file caused an
108 AT_SETUP([COMMENT at end of file])
109 AT_DATA([comment.sps], [dnl
110 COMMENT this is a comment at end of file.
112 AT_CHECK([pspp -O format=csv comment.sps])