mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
19603: Gracefully omit Y tests if zpty is not available
This commit is contained in:
parent
d351673349
commit
2ecaa07185
4 changed files with 55 additions and 43 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-03-11 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 19603: Test/Y01completion.ztst, Test/Y02compmatch.ztst,
|
||||
Test/Y03arguments.ztst: Gracefully omit tests if zsh/zpty is
|
||||
not available.
|
||||
|
||||
2004-03-11 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 19600: Completion/Unix/Command/_tla: rudimentary completion
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
# Tests for completion system.
|
||||
|
||||
%prep
|
||||
. $ZTST_srcdir/comptest
|
||||
|
||||
mkdir comp.tmp
|
||||
cd comp.tmp
|
||||
|
||||
comptestinit -z $ZTST_testdir/../Src/zsh &&
|
||||
{
|
||||
mkdir dir1 &&
|
||||
mkdir dir2 &&
|
||||
touch file1 &&
|
||||
touch file2
|
||||
}
|
||||
if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
|
||||
. $ZTST_srcdir/comptest
|
||||
mkdir comp.tmp
|
||||
cd comp.tmp
|
||||
comptestinit -z $ZTST_testdir/../Src/zsh &&
|
||||
{
|
||||
mkdir dir1 &&
|
||||
mkdir dir2 &&
|
||||
touch file1 &&
|
||||
touch file2
|
||||
}
|
||||
else
|
||||
ZTST_unimplemented="the zsh/zpty module is not available"
|
||||
fi
|
||||
|
||||
%test
|
||||
|
||||
|
|
|
@ -11,28 +11,30 @@
|
|||
# contains the compadd output.
|
||||
|
||||
%prep
|
||||
. $ZTST_srcdir/comptest
|
||||
|
||||
mkdir match.tmp
|
||||
cd match.tmp
|
||||
|
||||
comptestinit -z $ZTST_testdir/../Src/zsh &&
|
||||
{
|
||||
list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
|
||||
test_code () {
|
||||
matcher=$1;
|
||||
list=$2;
|
||||
code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
|
||||
code="$code$matcher"
|
||||
code="$code' - ${(P)list} ; echo -n '</COMPADD>'"
|
||||
code="$code; $extra_cmd"
|
||||
code="$code; echo -n '<INSERT_POSITIONS>'"
|
||||
code="$code; echo \$compstate[insert_positions]"
|
||||
code="$code; echo -n '</INSERT_POSITIONS>'"
|
||||
code="$code}"
|
||||
comptesteval "$code"
|
||||
if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
|
||||
. $ZTST_srcdir/comptest
|
||||
mkdir match.tmp
|
||||
cd match.tmp
|
||||
comptestinit -z $ZTST_testdir/../Src/zsh &&
|
||||
{
|
||||
list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
|
||||
test_code () {
|
||||
matcher=$1;
|
||||
list=$2;
|
||||
code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
|
||||
code="$code$matcher"
|
||||
code="$code' - ${(P)list} ; echo -n '</COMPADD>'"
|
||||
code="$code; $extra_cmd"
|
||||
code="$code; echo -n '<INSERT_POSITIONS>'"
|
||||
code="$code; echo \$compstate[insert_positions]"
|
||||
code="$code; echo -n '</INSERT_POSITIONS>'"
|
||||
code="$code}"
|
||||
comptesteval "$code"
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
ZTST_unimplemented="the zsh/zpty module is not available"
|
||||
fi
|
||||
|
||||
|
||||
%test
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
# Tests for _arguments.
|
||||
|
||||
%prep
|
||||
. $ZTST_srcdir/comptest
|
||||
|
||||
mkdir comp.tmp
|
||||
cd comp.tmp
|
||||
|
||||
comptestinit -z $ZTST_testdir/../Src/zsh &&
|
||||
{
|
||||
comptesteval 'compdef _tst tst'
|
||||
tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
|
||||
}
|
||||
if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
|
||||
. $ZTST_srcdir/comptest
|
||||
mkdir comp.tmp
|
||||
cd comp.tmp
|
||||
comptestinit -z $ZTST_testdir/../Src/zsh &&
|
||||
{
|
||||
comptesteval 'compdef _tst tst'
|
||||
tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
|
||||
}
|
||||
else
|
||||
ZTST_unimplemented="the zsh/zpty module is not available"
|
||||
fi
|
||||
|
||||
%test
|
||||
tst_arguments ':desc1:(arg1)'
|
||||
|
|
Loading…
Reference in a new issue