From d219f006097635e7eb28183d1a1da019336198e9 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 18 Jan 2017 09:59:42 +0000 Subject: 43080: a few more tests for autoload with absolute path --- Test/C04funcdef.ztst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Test/C04funcdef.ztst') diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst index 370394bf1..5edbe26bb 100644 --- a/Test/C04funcdef.ztst +++ b/Test/C04funcdef.ztst @@ -468,6 +468,31 @@ >fun2b >fun2a + not_trashed() { print This function was not trashed; } + autoload -Uz /foo/bar/not_trashed + not_trashed +0:autoload with absolute path doesn't trash loaded function +>This function was not trashed + + # keep spec from getting loaded in parent shell for simplicity + ( + if whence spec; then print spec already loaded >&2; exit 1; fi + autoload -Uz $PWD/spec + autoload -Uz $PWD/extra/spec + spec + ) +0:autoload with absolute path can be overridden if not yet loaded +>I have been loaded by explicit path. + + ( + if whence spec; then print spec already loaded >&2; exit 1; fi + autoload -Uz $PWD/extra/spec + autoload spec + spec + ) +0:autoload with absolute path not cancelled by bare autoload +>I have been loaded by explicit path. + %clean rm -f file.in file.out -- cgit 1.4.1