]> git.draconx.ca Git - cdecl99.git/blobdiff - tests/general.at
Fix empty and help commands causing program exit.
[cdecl99.git] / tests / general.at
index 337afddf4bd4953b7bade3b8eed25bc786266300..38493ce1e9d0a53dc05c0ff8f0f0e8f2649d7d55 100644 (file)
@@ -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