From 178e62dbfe464b56e3f12b01a159781d39b7bd85 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Thu, 12 Jan 2017 20:56:20 +0000
Subject: 40342: Add directory name cache for autoload file paths.
This renders "autoload /blah/blah/*" as efficient as use of
fpath.
---
Test/C04funcdef.ztst | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
(limited to 'Test/C04funcdef.ztst')
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
--
cgit 1.4.1