1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

Rocky Bernstein: 29135 (plus tweaks): compgen -W in bash completion

This commit is contained in:
Peter Stephenson 2011-05-04 08:53:53 +00:00
parent 3355155e82
commit 2e25dfb8fd
5 changed files with 56 additions and 8 deletions

View file

@ -42,6 +42,7 @@ V06parameter.ztst
Y01completion.ztst
Y02compmatch.ztst
Y03arguments.ztst
Y04compgen.ztst
comptest
runtests.zsh
ztst.zsh

21
Test/Y04compgen.ztst Normal file
View file

@ -0,0 +1,21 @@
# Tests for bash compgen compatibility.
%prep
if ( zmodload zsh/parameter ) >/dev/null 2>&1; then
. $ZTST_srcdir/compgentest
comptestinit -z $ZTST_testdir/../Src/zsh &&
else
ZTST_unimplemented="the zsh/parameter module is not available"
fi
%test
comptest $': \t\t\t\t\t\t\t'
0:bash compatibility: compgen -W
>abc
>abe
>ab
%clean
zmodload -ui zsh/parameter

15
Test/compgentest Normal file
View file

@ -0,0 +1,15 @@
comptestinit () {
setopt extendedglob
[[ -d $ZTST_testdir/Modules/zsh ]] && module_path=( $ZTST_testdir/Modules )
zmodload -i zsh/parameter || return $?
autoload -Uz bashcompinit || return $?
bashcompinit || return $?
}
comptest () {
compgen -W 'abc abe ab a def' ab
}