summaryrefslogtreecommitdiff
path: root/Test/Y02compmatch.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-03-11 19:14:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-03-11 19:14:38 +0000
commit2ecaa071856fe713195be416466c2441ecff226e (patch)
treecf258ce0cb53d0c169602cce037ddd24c70c5060 /Test/Y02compmatch.ztst
parentd351673349fbfd2f8365ba3d8f5919370a10df63 (diff)
downloadzsh-2ecaa071856fe713195be416466c2441ecff226e.tar.gz
zsh-2ecaa071856fe713195be416466c2441ecff226e.zip
19603: Gracefully omit Y tests if zpty is not available
Diffstat (limited to 'Test/Y02compmatch.ztst')
-rw-r--r--Test/Y02compmatch.ztst44
1 files changed, 23 insertions, 21 deletions
diff --git a/Test/Y02compmatch.ztst b/Test/Y02compmatch.ztst
index 4d4e0c0fa..abbe51bce 100644
--- a/Test/Y02compmatch.ztst
+++ b/Test/Y02compmatch.ztst
@@ -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