diff options
author | Peter Stephenson <pws@zsh.org> | 2017-01-18 09:59:42 +0000 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2017-01-18 09:59:42 +0000 |
commit | d219f006097635e7eb28183d1a1da019336198e9 (patch) | |
tree | 9a3d53844d1499a4a371b5f7d2bf9733170d7bf6 | |
parent | 4d6097657cb8f19846c5b9e09069f6d4e43882e0 (diff) | |
download | zsh-d219f006097635e7eb28183d1a1da019336198e9.tar.gz zsh-d219f006097635e7eb28183d1a1da019336198e9.tar.xz zsh-d219f006097635e7eb28183d1a1da019336198e9.zip |
43080: a few more tests for autoload with absolute path
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Test/C04funcdef.ztst | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 189399ac5..c7e9f1a1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-01-18 Peter Stephenson <p.stephenson@samsung.com> + * 43080: Test/C04funcdef.ztst: a few more tests for autoload + with absolute path. + * 40375: Src/builtin.c, Src/subst.c: autoload with explicit path mustn't trash already loaded function. Also drive-by removal of duplicated duplication in =cmd expansion. 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 |