From daa7d99702b8a3580b71ee74f962719ad1d052c8 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Fri, 13 Feb 2015 21:31:31 +0000
Subject: 34546: further $_ with anon function fix.
Also add tests.
---
Test/D04parameter.ztst | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
(limited to 'Test')
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index cf639fa8c..42c7b4ec6 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -1670,3 +1670,32 @@
print ${(e)param}
0:Alias expansion in command substitution in parameter evaluation
>Expanded in substitution
+
+ a=1 b=2 c=3
+ : One;
+ function {
+ : Two
+ echo $_
+ print -l $argv
+ } $_ Three
+ print -l $_ Four;
+0:$_ with anonymous function
+>Two
+>One
+>Three
+>Three
+>Four
+
+ a=1 b=2 c=3
+ : One
+ function {
+ : Two
+ echo $_
+ print -l $argv
+ }
+ print -l "$_" Four
+0:$_ with anonymous function without arguments
+>Two
+>
+>
+>Four
--
cgit 1.4.1