--- a/tests/commands.at
+++ b/tests/commands.at
@@ -636,6 +636,39 @@ c
 AT_CLEANUP()
 
 
+AT_SETUP([function])
+AT_KEYWORDS([commands])
+
+AT_DATA([function.csh],
+[[
+if ( ! { function test test } ) then
+  echo 'FAIL: '\''function'\'' is not passing arguments!'
+  exit 1
+else if >& /dev/null ( { function test2 } ) then
+  echo 'FAIL: '\''function'\'' is not seeking for an ending exit!'
+  exit 1
+else if >& /dev/null ( ! { function test3 } ) then
+  echo 'FAIL: '\''function'\'' is not seeking for an ending exit on EOF!'
+  exit 1
+endif
+exit
+
+test:
+if ( "$1" == ) exit 1
+exit
+
+test2:
+exit
+echo test
+
+test3:
+exit
+]])
+AT_CHECK([tcsh -f function.csh])
+
+AT_CLEANUP()
+
+
 dnl
 dnl	getspath
 dnl
@@ -1870,3 +1903,22 @@ endif
 AT_CHECK([tcsh -f time_output.csh], 0, [ignore])
 
 AT_CLEANUP()
+
+AT_SETUP([main function])
+AT_KEYWORDS([commands])
+
+AT_DATA([main.csh],
+[[
+if >& /dev/null ( { function test } ) then
+  echo 'FAIL: '\''function'\'' is not seeking for an ending first exit!'
+  exit 1
+endif
+exit
+echo test
+
+test:
+exit
+]])
+AT_CHECK([tcsh -f main.csh])
+
+AT_CLEANUP()
