tests: Convert a test for crash on invalid input to Autotest framework.
[pspp-builds.git] / tests / language / command.at
index f05086d1e7068f79697921333a503eaa518141e3..029e1b1fb9dab3f97899aca61f8730aac28e3073 100644 (file)
@@ -1,3 +1,18 @@
+AT_BANNER([command parser])
+
+dnl Tests for a bug which crashed pspp when given certain invalid input.
+AT_SETUP([command parser crash bug])
+AT_DATA([command.sps], [dnl
+DATA rubbish.
+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.
+])
+AT_CLEANUP
+
 AT_BANNER([ERASE])
 
 AT_SETUP([ERASE -- safer mode])