X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fcommand.at;h=ae91558ce14965b19950150da347153a390d8b90;hb=6f763403034b44b809fae1580dda3af0ab24a11b;hp=f05086d1e7068f79697921333a503eaa518141e3;hpb=d333d6f8945fd5d194f700a3b4dad3e4826efe29;p=pspp diff --git a/tests/language/command.at b/tests/language/command.at index f05086d1e7..ae91558ce1 100644 --- a/tests/language/command.at +++ b/tests/language/command.at @@ -1,3 +1,26 @@ +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 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 :; do echo; done) | pspp]) +AT_CLEANUP + AT_BANNER([ERASE]) AT_SETUP([ERASE -- safer mode]) @@ -62,3 +85,14 @@ x 15.00 ]) AT_CLEANUP + +AT_BANNER([COMMENT]) + +dnl Tests for a bug wherein a comment just before end-of-file caused an +dnl infinite loop. +AT_SETUP([COMMENT at end of file]) +AT_DATA([comment.sps], [dnl +COMMENT this is a comment at end of file. +]) +AT_CHECK([pspp -O format=csv comment.sps]) +AT_CLEANUP