1 AT_BANNER([command parser])
3 dnl Tests for a bug which crashed pspp when given certain invalid input.
4 AT_SETUP([command parser crash bug])
5 AT_DATA([command.sps], [dnl
9 AT_CHECK([pspp -O format=csv command.sps], [1], [dnl
10 command.sps:1: error: Unknown command `DATA rubbish'.
12 command.sps:2: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined.
16 dnl Tests for a bug where FINISH or EXIT wasn't executed until the lexer
17 dnl read the first token of the next command.
19 dnl (If this reecurs, the the test will run forever.)
20 AT_SETUP([FINISH executes immediately])
21 AT_CHECK([(echo "FINISH."; while :; do echo; done) | pspp])
26 AT_SETUP([ERASE -- safer mode])
27 AT_DATA([foobar], [contents
29 AT_DATA([erase.sps], [dnl
34 AT_CHECK([pspp -O format=csv erase.sps], [1], [dnl
35 erase.sps:3: error: ERASE: This command not allowed when the SAFER option is set.
37 AT_CHECK([cat foobar], [0], [contents
41 AT_SETUP([ERASE -- not safer mode])
42 AT_DATA([foobar], [contents
44 AT_CHECK([test -e foobar])
45 AT_DATA([erase.sps], [dnl
48 AT_CHECK([pspp -O format=csv erase.sps])
49 AT_CHECK([test ! -e foobar])
52 AT_BANNER([N OF CASES])
54 AT_SETUP([N OF CASES])
55 AT_DATA([n-of-cases.sps], [dnl
68 AT_CHECK([pspp -O format=csv n-of-cases.sps], [0], [dnl
91 dnl Tests for a bug wherein a comment just before end-of-file caused an
93 AT_SETUP([COMMENT at end of file])
94 AT_DATA([comment.sps], [dnl
95 COMMENT this is a comment at end of file.
97 AT_CHECK([pspp -O format=csv comment.sps])