summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Test')
-rw-r--r--Test/.distfiles1
-rw-r--r--Test/Y04compgen.ztst21
-rw-r--r--Test/compgentest15
3 files changed, 37 insertions, 0 deletions
diff --git a/Test/.distfiles b/Test/.distfiles
index 0e691743b..6a2d1bc4c 100644
--- a/Test/.distfiles
+++ b/Test/.distfiles
@@ -42,6 +42,7 @@ V06parameter.ztst
Y01completion.ztst
Y02compmatch.ztst
Y03arguments.ztst
+Y04compgen.ztst
comptest
runtests.zsh
ztst.zsh
diff --git a/Test/Y04compgen.ztst b/Test/Y04compgen.ztst
new file mode 100644
index 000000000..90dce6148
--- /dev/null
+++ b/Test/Y04compgen.ztst
@@ -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
diff --git a/Test/compgentest b/Test/compgentest
new file mode 100644
index 000000000..26b202c43
--- /dev/null
+++ b/Test/compgentest
@@ -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
+}
+