about summary refs log tree commit diff
path: root/Test/E02xtrace.ztst
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-06-10 17:37:02 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-06-13 08:53:18 +0000
commit7badf262c1a33c8c5f7ee8ccc152733fcb5a05f7 (patch)
tree980a039f4f16eb0cb0386bce202ae8c2ffff975d /Test/E02xtrace.ztst
parentaa160fc8e962c2f6df62c62d67e366644457966c (diff)
downloadzsh-7badf262c1a33c8c5f7ee8ccc152733fcb5a05f7.tar.gz
zsh-7badf262c1a33c8c5f7ee8ccc152733fcb5a05f7.tar.xz
zsh-7badf262c1a33c8c5f7ee8ccc152733fcb5a05f7.zip
38653 + 38657: 'functions -T' tracing: recurse into anonymous functions.
Diffstat (limited to 'Test/E02xtrace.ztst')
-rw-r--r--Test/E02xtrace.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/E02xtrace.ztst b/Test/E02xtrace.ztst
index 093a587bd..6e425e703 100644
--- a/Test/E02xtrace.ztst
+++ b/Test/E02xtrace.ztst
@@ -127,3 +127,20 @@
 ?+(eval):2> [[ 'f o' == f\ x* || 'b r' != z\ o && 'squashy sound' < 'squishy sound' ]]
 ?+(eval):3> [[ -e nonexistentfile || -z '' && -t 3 ]]
 ?+(eval):4> set +x
+
+  # Part 1: Recurses into nested anonymous functions
+  fn() {
+    () { () { true } }
+  }
+  functions -T fn
+  fn
+  # Part 2: Doesn't recurse into named functions
+  gn() { true }
+  fn() { gn }
+  functions -T fn
+  fn
+0:tracing recurses into anonymous functions
+?+fn:1> '(anon)'
+?+(anon):0> '(anon)'
+?+(anon):0> true
+?+fn:0> gn