MEANS: Prevent parser from entering infinite loop.
[pspp] / tests / language / command.at
index aa4eff53511b00a768087ced97357c4ac364b797..442355dbb63b1b2ba95cd17833ef9713392b79eb 100644 (file)
@@ -9,10 +9,18 @@ EXECUTE.
 AT_CHECK([pspp -O format=csv command.sps], [1], [dnl
 command.sps:1: error: Unknown command `DATA rubbish'.
 
-command.sps:2: error: EXECUTE: EXECUTE is allowed only after the active file has been defined.
+command.sps:2: error: EXECUTE: EXECUTE is allowed only after the active dataset has been defined.
 ])
 AT_CLEANUP
 
+dnl Tests for a bug where FINISH or EXIT wasn't executed until the lexer
+dnl read the first token of the next command.
+dnl
+dnl (If this reecurs, the the test will run forever.)
+AT_SETUP([FINISH executes immediately])
+AT_CHECK([(echo "FINISH."; while echo ; do true; done) | pspp], [0], [ignore], [ignore])
+AT_CLEANUP
+
 AT_BANNER([ERASE])
 
 AT_SETUP([ERASE -- safer mode])