X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/24a138b38b11dcfc5f7c360d601244af14c5488a..32785fcd767c52ce826f8f0ed4232360e458f118:/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