X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/519f8a57b1353d595b3e6e9aa0ff50eaffb164ca..1964240454d93493ee68a75b171fdf7934332200:/tests/general.at diff --git a/tests/general.at b/tests/general.at index 337afdd..38493ce 100644 --- a/tests/general.at +++ b/tests/general.at @@ -29,3 +29,46 @@ AT_CHECK([$SHELL "$builddir/exported.sh" "$archive" || exit 99], [0], [stdout]) AT_CHECK([sed '/^cdecl_/d' stdout]) AT_CLEANUP + +dnl Verify that empty commands do nothing. +AT_SETUP([cdecl99 empty command]) + +AT_DATA([input], [[explain int x[42]; + +declare x as array 42 of int + +explain int + +]]) + +AT_CHECK([cdecl99 -f input], [0], [[declare x as array 42 of int +int x[42] +type int +]]) + +AT_CLEANUP + +dnl Verify that commands are not executed after "quit" +AT_SETUP([cdecl99 quit command]) + +AT_DATA([input], [[explain int; +quit +explain this is a syntax error +]]) + +AT_CHECK([cdecl99 -f input], [0], [type int +]) + +AT_CLEANUP + +AT_SETUP([cdecl99 help command]) + +AT_DATA([input], [[help +explain int +]]) + +AT_CHECK([cdecl99 -f input], [0], [stdout]) +AT_CHECK([sed -n '$p' stdout], [0], [type int +]) + +AT_CLEANUP