about summary refs log tree commit diff
path: root/Test/C04funcdef.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-06-19 20:12:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-06-19 20:12:00 +0000
commit6062529d3fc7c7d29c63d0726d2449d4b56f33ac (patch)
tree8131c4e1678053413559fe71159201f891786a70 /Test/C04funcdef.ztst
parent437d5d98f6d05588e23a6d9fda50184d0b6a80bb (diff)
downloadzsh-6062529d3fc7c7d29c63d0726d2449d4b56f33ac.tar.gz
zsh-6062529d3fc7c7d29c63d0726d2449d4b56f33ac.tar.xz
zsh-6062529d3fc7c7d29c63d0726d2449d4b56f33ac.zip
29492: add argument handling to anonymous functions
Diffstat (limited to 'Test/C04funcdef.ztst')
-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