summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-12 20:56:20 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-12 20:56:20 +0000
commit178e62dbfe464b56e3f12b01a159781d39b7bd85 (patch)
tree8c9b707a840eb71b69292cfc4085131b3a720eaf /Test
parent33799ae2b00c09445e2e47720bc740ec434416e4 (diff)
downloadzsh-178e62dbfe464b56e3f12b01a159781d39b7bd85.tar.gz
zsh-178e62dbfe464b56e3f12b01a159781d39b7bd85.tar.xz
zsh-178e62dbfe464b56e3f12b01a159781d39b7bd85.zip
40342: Add directory name cache for autoload file paths.
This renders "autoload /blah/blah/*" as efficient as use of
fpath.
Diffstat (limited to 'Test')
-rw-r--r--Test/C04funcdef.ztst39
1 files changed, 39 insertions, 0 deletions
diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst
index 7100280f3..370394bf1 100644
--- a/Test/C04funcdef.ztst
+++ b/Test/C04funcdef.ztst
@@ -429,6 +429,45 @@
 0: autoload -X interaction with absolute filename used for source location
 >Function was loaded correctly.
 
+  (
+    fpath=()
+    mkdir extra2
+    for f in fun2a fun2b; do
+      print "print $f" >extra2/$f
+    done
+    repeat 3; do
+      autoload $PWD/extra2/fun2{a,b} $PWD/extra/spec
+      fun2a
+      fun2b
+      spec
+      unfunction fun2a fun2b spec
+      autoload $PWD/extra2/fun2{a,b} $PWD/extra/spec
+      spec
+      fun2b
+      fun2a
+      unfunction fun2a fun2b spec
+    done
+  )
+0: Exercise the directory name cache for autoloads
+>fun2a
+>fun2b
+>I have been loaded by explicit path.
+>I have been loaded by explicit path.
+>fun2b
+>fun2a
+>fun2a
+>fun2b
+>I have been loaded by explicit path.
+>I have been loaded by explicit path.
+>fun2b
+>fun2a
+>fun2a
+>fun2b
+>I have been loaded by explicit path.
+>I have been loaded by explicit path.
+>fun2b
+>fun2a
+
 %clean
 
  rm -f file.in file.out