about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Test')
-rw-r--r--Test/C04funcdef.ztst29
1 files changed, 28 insertions, 1 deletions
diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst
index f71e5ce77..0cc5e5a2f 100644
--- a/Test/C04funcdef.ztst
+++ b/Test/C04funcdef.ztst
@@ -26,7 +26,7 @@
     print regress expansion of function names
   }
   f$$
-0:Regression test: `function f$$ () { ... }'
+0:Regression test: 'function f$$ () { ... }'
 >regress expansion of function names
 
   function foo () print bar
@@ -109,6 +109,8 @@
 >really useful
 >args
 
+# ' deconfuse emacs
+
   command_not_found_handler() {
      print "Your command:" >&2
      print "$1" >&2
@@ -201,6 +203,31 @@
 >Da de da
 >Do be do
 
+  () { print This has arguments $*; } of all sorts; print After the function
+  function { print More stuff $*; } and why not; print Yet more
+0:Anonymous function with arguments
+>This has arguments of all sorts
+>After the function
+>More stuff and why not
+>Yet more
+
+  fn() {
+    (){ print Anonymous function 1 $*; } with args
+    function { print Anonymous function 2 $*; } with more args
+    print Following bit
+  }
+  functions fn
+0:Text representation of anonymous function with arguments
+>fn () {
+>	() {
+>		print Anonymous function 1 $*
+>	} with args
+>	() {
+>		print Anonymous function 2 $*
+>	} with more args
+>	print Following bit
+>}
+
 %clean
 
  rm -f file.in file.out