about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-03-16 11:51:37 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-03-16 11:51:37 +0000
commitf9ffde8e3c19cb9606f8ae4a7e098be38e807542 (patch)
tree5c9efa0e36f1d7b7245c0326de4b3fcb79fc9824 /Test
parent24faafa24eb47a801652108c495b37003d45a193 (diff)
downloadzsh-f9ffde8e3c19cb9606f8ae4a7e098be38e807542.tar.gz
zsh-f9ffde8e3c19cb9606f8ae4a7e098be38e807542.tar.xz
zsh-f9ffde8e3c19cb9606f8ae4a7e098be38e807542.zip
20983: failed glob from fixed strings segments in globbed paths
Diffstat (limited to 'Test')
-rw-r--r--Test/D02glob.ztst325
-rw-r--r--Test/V01zmodload.ztst166
2 files changed, 491 insertions, 0 deletions
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
new file mode 100644
index 000000000..e423176a3
--- /dev/null
+++ b/Test/D02glob.ztst
@@ -0,0 +1,325 @@
+# Tests for globbing
+
+%prep
+  mkdir glob.tmp
+  mkdir glob.tmp/dir{1,2,3,4}
+  mkdir glob.tmp/dir3/subdir
+  : >glob.tmp/{,{dir1,dir2}/}{a,b,c}
+
+  globtest () { $ZTST_testdir/../Src/zsh -f $ZTST_srcdir/../Misc/$1 }
+
+  regress_absolute_path_and_core_dump() {
+    local absolute_dir=$(cd glob.tmp && pwd -P)
+    [[ -n $absolute_dir ]] || return 1
+    setopt localoptions extendedglob nullglob
+    print $absolute_dir/**/*~/*
+    setopt nonullglob nomatch
+    print glob.tmp/**/*~(.)#
+  }
+
+%test
+
+  globtest globtests
+0:zsh globbing
+>0:  [[ foo~ = foo~ ]]
+>0:  [[ foo~ = (foo~) ]]
+>0:  [[ foo~ = (foo~|) ]]
+>0:  [[ foo.c = *.c~boo* ]]
+>1:  [[ foo.c = *.c~boo*~foo* ]]
+>0:  [[ fofo = (fo#)# ]]
+>0:  [[ ffo = (fo#)# ]]
+>0:  [[ foooofo = (fo#)# ]]
+>0:  [[ foooofof = (fo#)# ]]
+>0:  [[ fooofoofofooo = (fo#)# ]]
+>1:  [[ foooofof = (fo##)# ]]
+>1:  [[ xfoooofof = (fo#)# ]]
+>1:  [[ foooofofx = (fo#)# ]]
+>0:  [[ ofxoofxo = ((ofo#x)#o)# ]]
+>1:  [[ ofooofoofofooo = (fo#)# ]]
+>0:  [[ foooxfooxfoxfooox = (fo#x)# ]]
+>1:  [[ foooxfooxofoxfooox = (fo#x)# ]]
+>0:  [[ foooxfooxfxfooox = (fo#x)# ]]
+>0:  [[ ofxoofxo = ((ofo#x)#o)# ]]
+>0:  [[ ofoooxoofxo = ((ofo#x)#o)# ]]
+>0:  [[ ofoooxoofxoofoooxoofxo = ((ofo#x)#o)# ]]
+>0:  [[ ofoooxoofxoofoooxoofxoo = ((ofo#x)#o)# ]]
+>1:  [[ ofoooxoofxoofoooxoofxofo = ((ofo#x)#o)# ]]
+>0:  [[ ofoooxoofxoofoooxoofxooofxofxo = ((ofo#x)#o)# ]]
+>0:  [[ aac = ((a))#a(c) ]]
+>0:  [[ ac = ((a))#a(c) ]]
+>1:  [[ c = ((a))#a(c) ]]
+>0:  [[ aaac = ((a))#a(c) ]]
+>1:  [[ baaac = ((a))#a(c) ]]
+>0:  [[ abcd = ?(a|b)c#d ]]
+>0:  [[ abcd = (ab|ab#)c#d ]]
+>0:  [[ acd = (ab|ab#)c#d ]]
+>0:  [[ abbcd = (ab|ab#)c#d ]]
+>0:  [[ effgz = (bc##d|ef#g?|(h|)i(j|k)) ]]
+>0:  [[ efgz = (bc##d|ef#g?|(h|)i(j|k)) ]]
+>0:  [[ egz = (bc##d|ef#g?|(h|)i(j|k)) ]]
+>0:  [[ egzefffgzbcdij = (bc##d|ef#g?|(h|)i(j|k))# ]]
+>1:  [[ egz = (bc##d|ef##g?|(h|)i(j|k)) ]]
+>0:  [[ ofoofo = (ofo##)# ]]
+>0:  [[ oxfoxoxfox = (oxf(ox)##)# ]]
+>1:  [[ oxfoxfox = (oxf(ox)##)# ]]
+>0:  [[ ofoofo = (ofo##|f)# ]]
+>0:  [[ foofoofo = (foo|f|fo)(f|ofo##)# ]]
+>0:  [[ oofooofo = (of|oofo##)# ]]
+>0:  [[ fffooofoooooffoofffooofff = (f#o#)# ]]
+>1:  [[ fffooofoooooffoofffooofffx = (f#o#)# ]]
+>0:  [[ fofoofoofofoo = (fo|foo)# ]]
+>0:  [[ foo = ((^x)) ]]
+>0:  [[ foo = ((^x)*) ]]
+>1:  [[ foo = ((^foo)) ]]
+>0:  [[ foo = ((^foo)*) ]]
+>0:  [[ foobar = ((^foo)) ]]
+>0:  [[ foobar = ((^foo)*) ]]
+>1:  [[ foot = z*~*x ]]
+>0:  [[ zoot = z*~*x ]]
+>1:  [[ foox = z*~*x ]]
+>1:  [[ zoox = z*~*x ]]
+>0:  [[ moo.cow = (*~*.*).(*~*.*) ]]
+>1:  [[ mad.moo.cow = (*~*.*).(*~*.*) ]]
+>0:  [[ moo.cow = (^*.*).(^*.*) ]]
+>1:  [[ sane.moo.cow = (^*.*).(^*.*) ]]
+>1:  [[ mucca.pazza = mu(^c#)?.pa(^z#)? ]]
+>1:  [[ _foo~ = _(|*[^~]) ]]
+>0:  [[ fff = ((^f)) ]]
+>0:  [[ fff = ((^f)#) ]]
+>0:  [[ fff = ((^f)##) ]]
+>0:  [[ ooo = ((^f)) ]]
+>0:  [[ ooo = ((^f)#) ]]
+>0:  [[ ooo = ((^f)##) ]]
+>0:  [[ foo = ((^f)) ]]
+>0:  [[ foo = ((^f)#) ]]
+>0:  [[ foo = ((^f)##) ]]
+>1:  [[ f = ((^f)) ]]
+>1:  [[ f = ((^f)#) ]]
+>1:  [[ f = ((^f)##) ]]
+>0:  [[ foot = (^z*|*x) ]]
+>1:  [[ zoot = (^z*|*x) ]]
+>0:  [[ foox = (^z*|*x) ]]
+>0:  [[ zoox = (^z*|*x) ]]
+>0:  [[ foo = (^foo)# ]]
+>1:  [[ foob = (^foo)b* ]]
+>0:  [[ foobb = (^foo)b* ]]
+>1:  [[ foob = (*~foo)b* ]]
+>0:  [[ foobb = (*~foo)b* ]]
+>1:  [[ zsh = ^z* ]]
+>0:  [[ a%1X = [[:alpha:][:punct:]]#[[:digit:]][^[:lower:]] ]]
+>1:  [[ a%1 = [[:alpha:][:punct:]]#[[:digit:]][^[:lower:]] ]]
+>0:  [[ [: = [[:]# ]]
+>0:  [[ :] = []:]# ]]
+>0:  [[ :] = [:]]# ]]
+>0:  [[ [ = [[] ]]
+>0:  [[ ] = []] ]]
+>0:  [[ [] = [^]]] ]]
+>0:  [[ fooxx = (#i)FOOXX ]]
+>1:  [[ fooxx = (#l)FOOXX ]]
+>0:  [[ FOOXX = (#l)fooxx ]]
+>1:  [[ fooxx = (#i)FOO(#I)X(#i)X ]]
+>0:  [[ fooXx = (#i)FOO(#I)X(#i)X ]]
+>0:  [[ fooxx = ((#i)FOOX)x ]]
+>1:  [[ fooxx = ((#i)FOOX)X ]]
+>1:  [[ BAR = (bar|(#i)foo) ]]
+>0:  [[ FOO = (bar|(#i)foo) ]]
+>0:  [[ Modules = (#i)*m* ]]
+>0:  [[ fooGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
+>1:  [[ FOOGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
+>0:  [[ readme = (#i)readme~README|readme ]]
+>0:  [[ readme = (#i)readme~README|readme~README ]]
+>0:  [[ 633 = <1-1000>33 ]]
+>0:  [[ 633 = <-1000>33 ]]
+>0:  [[ 633 = <1->33 ]]
+>0:  [[ 633 = <->33 ]]
+>0:  [[ 12345678901234567890123456789012345678901234567890123456789012345678901234567890foo = <42->foo ]]
+>0:  [[ READ.ME = (#ia1)readme ]]
+>1:  [[ READ..ME = (#ia1)readme ]]
+>0:  [[ README = (#ia1)readm ]]
+>0:  [[ READM = (#ia1)readme ]]
+>0:  [[ README = (#ia1)eadme ]]
+>0:  [[ EADME = (#ia1)readme ]]
+>0:  [[ READEM = (#ia1)readme ]]
+>1:  [[ ADME = (#ia1)readme ]]
+>1:  [[ README = (#ia1)read ]]
+>0:  [[ bob = (#a1)[b][b] ]]
+>1:  [[ bob = (#a1)[b][b]a ]]
+>0:  [[ bob = (#a1)[b]o[b]a ]]
+>1:  [[ bob = (#a1)[c]o[b] ]]
+>0:  [[ abcd = (#a2)XbcX ]]
+>0:  [[ abcd = (#a2)ad ]]
+>0:  [[ ad = (#a2)abcd ]]
+>0:  [[ abcd = (#a2)bd ]]
+>0:  [[ bd = (#a2)abcd ]]
+>0:  [[ badc = (#a2)abcd ]]
+>0:  [[ adbc = (#a2)abcd ]]
+>1:  [[ dcba = (#a2)abcd ]]
+>0:  [[ dcba = (#a3)abcd ]]
+>0:  [[ aabaXaaabY = (#a1)(a#b)#Y ]]
+>0:  [[ aabaXaaabY = (#a1)(a#b)(a#b)Y ]]
+>0:  [[ aaXaaaaabY = (#a1)(a#b)(a#b)Y ]]
+>0:  [[ aaaXaaabY = (#a1)(a##b)##Y ]]
+>0:  [[ aaaXbaabY = (#a1)(a##b)##Y ]]
+>1:  [[ read.me = (#ia1)README~READ.ME ]]
+>0:  [[ read.me = (#ia1)README~READ_ME ]]
+>1:  [[ read.me = (#ia1)README~(#a1)READ_ME ]]
+>0:  [[ test = *((#s)|/)test((#e)|/)* ]]
+>0:  [[ test/path = *((#s)|/)test((#e)|/)* ]]
+>0:  [[ path/test = *((#s)|/)test((#e)|/)* ]]
+>0:  [[ path/test/ohyes = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ atest = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ testy = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ testy/path = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ path/atest = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ atest/path = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ path/testy = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ path/testy/ohyes = *((#s)|/)test((#e)|/)* ]]
+>1:  [[ path/atest/ohyes = *((#s)|/)test((#e)|/)* ]]
+>0:  [[ björn = *[åäöÅÄÖ]* ]]
+>0 tests failed.
+
+  globtest globtests.ksh
+0:ksh compatibility
+>0:  [[ fofo = *(f*(o)) ]]
+>0:  [[ ffo = *(f*(o)) ]]
+>0:  [[ foooofo = *(f*(o)) ]]
+>0:  [[ foooofof = *(f*(o)) ]]
+>0:  [[ fooofoofofooo = *(f*(o)) ]]
+>1:  [[ foooofof = *(f+(o)) ]]
+>1:  [[ xfoooofof = *(f*(o)) ]]
+>1:  [[ foooofofx = *(f*(o)) ]]
+>0:  [[ ofxoofxo = *(*(of*(o)x)o) ]]
+>1:  [[ ofooofoofofooo = *(f*(o)) ]]
+>0:  [[ foooxfooxfoxfooox = *(f*(o)x) ]]
+>1:  [[ foooxfooxofoxfooox = *(f*(o)x) ]]
+>0:  [[ foooxfooxfxfooox = *(f*(o)x) ]]
+>0:  [[ ofxoofxo = *(*(of*(o)x)o) ]]
+>0:  [[ ofoooxoofxo = *(*(of*(o)x)o) ]]
+>0:  [[ ofoooxoofxoofoooxoofxo = *(*(of*(o)x)o) ]]
+>0:  [[ ofoooxoofxoofoooxoofxoo = *(*(of*(o)x)o) ]]
+>1:  [[ ofoooxoofxoofoooxoofxofo = *(*(of*(o)x)o) ]]
+>0:  [[ ofoooxoofxoofoooxoofxooofxofxo = *(*(of*(o)x)o) ]]
+>0:  [[ aac = *(@(a))a@(c) ]]
+>0:  [[ ac = *(@(a))a@(c) ]]
+>1:  [[ c = *(@(a))a@(c) ]]
+>0:  [[ aaac = *(@(a))a@(c) ]]
+>1:  [[ baaac = *(@(a))a@(c) ]]
+>0:  [[ abcd = ?@(a|b)*@(c)d ]]
+>0:  [[ abcd = @(ab|a*@(b))*(c)d ]]
+>0:  [[ acd = @(ab|a*(b))*(c)d ]]
+>0:  [[ abbcd = @(ab|a*(b))*(c)d ]]
+>0:  [[ effgz = @(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]]
+>0:  [[ efgz = @(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]]
+>0:  [[ egz = @(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]]
+>0:  [[ egzefffgzbcdij = *(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]]
+>1:  [[ egz = @(b+(c)d|e+(f)g?|?(h)i@(j|k)) ]]
+>0:  [[ ofoofo = *(of+(o)) ]]
+>0:  [[ oxfoxoxfox = *(oxf+(ox)) ]]
+>1:  [[ oxfoxfox = *(oxf+(ox)) ]]
+>0:  [[ ofoofo = *(of+(o)|f) ]]
+>0:  [[ foofoofo = @(foo|f|fo)*(f|of+(o)) ]]
+>0:  [[ oofooofo = *(of|oof+(o)) ]]
+>0:  [[ fffooofoooooffoofffooofff = *(*(f)*(o)) ]]
+>1:  [[ fffooofoooooffoofffooofffx = *(*(f)*(o)) ]]
+>0:  [[ fofoofoofofoo = *(fo|foo) ]]
+>0:  [[ foo = !(x) ]]
+>0:  [[ foo = !(x)* ]]
+>1:  [[ foo = !(foo) ]]
+>0:  [[ foo = !(foo)* ]]
+>0:  [[ foobar = !(foo) ]]
+>0:  [[ foobar = !(foo)* ]]
+>0:  [[ moo.cow = !(*.*).!(*.*) ]]
+>1:  [[ mad.moo.cow = !(*.*).!(*.*) ]]
+>1:  [[ mucca.pazza = mu!(*(c))?.pa!(*(z))? ]]
+>1:  [[ _foo~ = _?(*[^~]) ]]
+>0:  [[ fff = !(f) ]]
+>0:  [[ fff = *(!(f)) ]]
+>0:  [[ fff = +(!(f)) ]]
+>0:  [[ ooo = !(f) ]]
+>0:  [[ ooo = *(!(f)) ]]
+>0:  [[ ooo = +(!(f)) ]]
+>0:  [[ foo = !(f) ]]
+>0:  [[ foo = *(!(f)) ]]
+>0:  [[ foo = +(!(f)) ]]
+>1:  [[ f = !(f) ]]
+>1:  [[ f = *(!(f)) ]]
+>1:  [[ f = +(!(f)) ]]
+>0:  [[ foot = @(!(z*)|*x) ]]
+>1:  [[ zoot = @(!(z*)|*x) ]]
+>0:  [[ foox = @(!(z*)|*x) ]]
+>0:  [[ zoox = @(!(z*)|*x) ]]
+>0:  [[ foo = *(!(foo)) ]]
+>1:  [[ foob = !(foo)b* ]]
+>0:  [[ foobb = !(foo)b* ]]
+>0:  [[ fooxx = (#i)FOOXX ]]
+>1:  [[ fooxx = (#l)FOOXX ]]
+>0:  [[ FOOXX = (#l)fooxx ]]
+>1:  [[ fooxx = (#i)FOO@(#I)X@(#i)X ]]
+>0:  [[ fooXx = (#i)FOO@(#I)X@(#i)X ]]
+>0:  [[ fooxx = @((#i)FOOX)x ]]
+>1:  [[ fooxx = @((#i)FOOX)X ]]
+>1:  [[ BAR = @(bar|(#i)foo) ]]
+>0:  [[ FOO = @(bar|(#i)foo) ]]
+>0:  [[ Modules = (#i)*m* ]]
+>0 tests failed.
+
+  ( regress_absolute_path_and_core_dump )
+0:exclusions regression test
+>
+>glob.tmp/a glob.tmp/b glob.tmp/c glob.tmp/dir1 glob.tmp/dir1/a glob.tmp/dir1/b glob.tmp/dir1/c glob.tmp/dir2 glob.tmp/dir2/a glob.tmp/dir2/b glob.tmp/dir2/c glob.tmp/dir3 glob.tmp/dir3/subdir glob.tmp/dir4
+
+ print glob.tmp/*(/)
+0:Just directories
+>glob.tmp/dir1 glob.tmp/dir2 glob.tmp/dir3 glob.tmp/dir4
+
+ print glob.tmp/*(.)
+0:Just files
+>glob.tmp/a glob.tmp/b glob.tmp/c
+
+ print glob.tmp/*(.e^'reply=( glob.tmp/*/${REPLY:t} )'^:t)
+0:Globbing used recursively (inside e glob qualifier)
+>a a b b c c
+
+ print glob.tmp/**/(:h) 
+0:Head modifier
+>. glob.tmp glob.tmp glob.tmp glob.tmp glob.tmp/dir3
+
+ print glob.tmp(:r)
+0:Remove extension modifier
+>glob
+
+ print glob.tmp/*(:s/./_/)
+0:Substitute modifier
+>glob_tmp/a glob_tmp/b glob_tmp/c glob_tmp/dir1 glob_tmp/dir2 glob_tmp/dir3 glob_tmp/dir4
+
+ print glob.tmp/*(F)
+0:Just full dirs
+>glob.tmp/dir1 glob.tmp/dir2 glob.tmp/dir3
+
+ print glob.tmp/*(^F)
+0:Omit full dirs
+>glob.tmp/a glob.tmp/b glob.tmp/c glob.tmp/dir4
+
+ print glob.tmp/*(/^F)
+0:Just empty dirs
+>glob.tmp/dir4
+
+ setopt extendedglob
+ print glob.tmp/**/*~*/dir3(/*|(#e))(/)
+0:Exclusions with complicated path specifications
+>glob.tmp/dir1 glob.tmp/dir2 glob.tmp/dir4
+
+ [[ "" = "" ]] && echo OK
+0:Empty strings
+>OK
+
+ foo="this string has a : colon in it"
+ print ${foo%% #:*}
+0:Must-match arguments in complex patterns
+>this string has a
+
+ mkdir glob.tmp/ra=1.0_et=3.5
+ touch glob.tmp/ra=1.0_et=3.5/foo
+ print glob.tmp/ra=1.0_et=3.5/???
+0:Bug with intermediate paths with plain strings but tokenized characters
+>glob.tmp/ra=1.0_et=3.5/foo
diff --git a/Test/V01zmodload.ztst b/Test/V01zmodload.ztst
new file mode 100644
index 000000000..d26ae1e42
--- /dev/null
+++ b/Test/V01zmodload.ztst
@@ -0,0 +1,166 @@
+# Test basic module loading
+
+%prep
+# Figure out which modules it ought to be possible to load by looking at
+# the config.modules file.  This differs for static vs. dynamic builds.
+
+ mods=()
+ deps="$(zmodload -Ld)"
+ while read name modfile link auto load funcs
+ do
+   [[ $name == \#* ]] && continue
+   eval "$name $modfile $link $auto $load"
+   [[ $link == no ]] && continue
+   mods=($mods $name)
+   moddeps=
+   modfile=$ZTST_srcdir/../$modfile
+   eval ${${${(f)"$(<$modfile)"}[(r)moddeps=*]}:-:}
+   [[ -n $moddeps ]] && zmodload -d $name $=moddeps
+ done < $ZTST_testdir/../config.modules
+
+ zmodunload() {
+   local m n=$#
+   (( n == 0 )) && return 0
+   for m
+   do
+     if [[ -z ${(M)${(f)"$(zmodload -d)"}:#*:* $m( *|)} ]]
+     then
+       zmodload -u $m && zmodload -ud $m || return 1
+       shift
+     else
+       set $@[2,-1] $m
+     fi
+   done
+   if (( $# < n ))
+   then
+     zmodunload $*
+   else
+     zmodload -u $*
+   fi
+ }
+
+%test
+
+# This first test depends on knowing that zsh is run with +Z from the
+# Makefile, and that ztst.zsh loads the parameter module.
+
+ zmodload -L
+0:List the loaded modules
+>zmodload zsh/main
+>zmodload zsh/parameter
+
+ zmodload zsh/main
+1:Test reloading an already-loaded module
+?(eval):zmodload:1: module zsh/main already loaded.
+
+# Loop over the modules found above and attempt to load each one.  Use
+# the -i flag in case dependencies cause multiple modules to be loaded,
+# or in case some previous test suite loaded a module.
+
+ for m in $mods
+ do
+   zmodload -i $m || mods[(r)$m]=()
+ done
+0d:Test loading of all compiled modules
+
+ zmodload -e $mods
+0d:Check that zsh believes the modules did load
+
+# Now check for proper failure conditions by trying some operations on
+# a nonexistent module.
+
+ zmodload -i bogus/notamodule
+1D:Check that loading a nonexistent module fails
+
+ zmodload -u bogus/notamodule
+1D:Check that unloading a nonexistent module fails
+
+# Test adding and removing autoloads, using a nonexistent module.
+
+ zmodload -ab bogus
+ zmodload -ub bogus
+0:Add/remove autoloaded builtin
+
+ zmodload -ac bogus
+ zmodload -uc bogus
+0:Add/remove autoloaded condition
+
+ zmodload -ap bogus
+ zmodload -up bogus
+0:Add/remove autoloaded parameter
+
+ zmodload -af bogus
+ zmodload -uf bogus
+0:Add/remove autoloaded math function
+
+# If the "example" module is available, test various autoloading behavior.
+
+ if [[ $mods[(r)zsh/example] == zsh/example ]]; then
+   zmodload -u zsh/example
+   zmodload -ab zsh/example example
+   builtin example
+   zmodload -e zsh/example
+ else print -u8 Warning: zsh/example not linked: not checking autoloading
+ fi
+0d:Autoload a module via a builtin
+
+ if [[ $mods[(r)zsh/example] == zsh/example ]]; then
+   zmodload -u zsh/example
+   zmodload -ac -I zsh/example ex
+   [[ exam -ex ple ]]
+   zmodload -e zsh/example
+ else :
+ fi
+0d:Autoload a module via a condition
+
+ if [[ $mods[(r)zsh/example] == zsh/example ]]; then
+   zmodload -u zsh/example
+   zmodload -ap zsh/example exint
+   : $exint
+   zmodload -e zsh/example
+ else :
+ fi
+0d:Autoload a module via a parameter
+
+ if [[ $mods[(r)zsh/example] == zsh/example ]]; then
+   zmodload -u zsh/example
+   zmodload -af zsh/example sum
+   (( sum(1) ))
+   zmodload -e zsh/example
+ else :
+ fi
+0d:Autoload a module via a math function
+
+# Test module aliases
+
+ zmodload -A example=zsh/example
+ zmodload -A
+0:Test creating a module alias
+>example -> zsh/example
+
+ if [[ $mods[(r)zsh/example] == zsh/example ]]; then
+   zmodload -u example
+   zmodload -ab example
+   builtin example
+   zmodload -e example
+ else :
+ fi
+0d:Unload/autoload the module via its alias
+
+ zmodload -R example
+ zmodload -e example
+1:Delete the module alias again
+
+# Don't unload the main module.
+# Do unload zsh/parameter, but reload it as it is needed.
+
+ mods[(r)zsh/main]=()
+ zmodunload $mods
+ zmodload zsh/parameter
+0d:Unload the modules loaded by this test suite
+
+%clean
+
+ eval "$deps"
+ unset deps name modfile link auto load funcs mods moddeps
+ unfunction zmodunload