summaryrefslogtreecommitdiffstats
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-04-01 20:49:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-04-01 20:49:47 +0000
commit48525452555a24b9d41748f26b4b77f160f01220 (patch)
treed814ca2f017d9d843fec7d286fefbca78244beb5 /Test
parentUpdated from list as far as 10376 (diff)
downloadzsh-48525452555a24b9d41748f26b4b77f160f01220.tar
zsh-48525452555a24b9d41748f26b4b77f160f01220.tar.gz
zsh-48525452555a24b9d41748f26b4b77f160f01220.tar.bz2
zsh-48525452555a24b9d41748f26b4b77f160f01220.tar.lz
zsh-48525452555a24b9d41748f26b4b77f160f01220.tar.xz
zsh-48525452555a24b9d41748f26b4b77f160f01220.tar.zst
zsh-48525452555a24b9d41748f26b4b77f160f01220.zip
Updated from list as far as 10376
Diffstat (limited to 'Test')
-rw-r--r--Test/07cond.ztst35
-rw-r--r--Test/11glob.ztst19
-rw-r--r--Test/53completion.ztst13
3 files changed, 54 insertions, 13 deletions
diff --git a/Test/07cond.ztst b/Test/07cond.ztst
index 7fff51ce2..1d1ba6679 100644
--- a/Test/07cond.ztst
+++ b/Test/07cond.ztst
@@ -11,10 +11,11 @@
touch unmodified
touch zerolength
+ chgrp $EGID zerolength
print 'Garbuglio' >nonzerolength
- touch modish
- chmod g+s modish
+ mkdir modish
+ chmod g+xs modish
chmod u+s modish
chmod +t modish
@@ -26,7 +27,11 @@
0:-a cond
# Find a block special file system. This is a little tricky.
- block=$(df / | tail -1 | awk '{ print $1 }') &&
+ block=$(df / | awk '
+ $NF == "/" {print $1}
+ $1 == "/" && substr($2,0,1) == "(" {
+ if((l = index($2,")") - 2) < 0) l = length($2) - 1;
+ print substr($2,2,l)}') &&
[[ -b $block && ! -b zerolength ]]
0:-b cond
@@ -61,7 +66,11 @@
[[ -o rcs && ! -o norcs && -o noerrexit && ! -o errexit ]]
0:-o cond
- mknod pipe p
+ if whence mkfifo >/dev/null; then
+ mkfifo pipe
+ else
+ mknod pipe p
+ fi
[[ -p pipe && ! -p zerolength ]]
0:-p cond
@@ -76,7 +85,7 @@
[[ -u modish && ! -u zerolength ]]
0:-u cond
- [[ -x $ZTST_testdir/ztst.zsh && ! -x zerolength ]]
+ [[ -x $ZTST_srcdir/ztst.zsh && ! -x zerolength ]]
0:-x cond
[[ -z $bar && -z '' && ! -z $foo ]]
@@ -89,8 +98,6 @@
[[ -O zerolength ]]
0:-O cond
-# there may be strange cases where this doesn't work, e.g.
-# inherited funny groups for directories via setgid.
[[ -G zerolength ]]
0:-G cond
@@ -132,4 +139,16 @@
0:|| and && in conds
[[ -e /dev/fd/0 ]]
-0:/dev/fd support in conds
+0:/dev/fd support in conds handled by access
+
+ [[ -O /dev/fd/0 ]]
+0:/dev/fd support in conds handled by stat
+
+ [[ ( -z foo && -z foo ) || -z foo ]]
+1:complex conds with skipping
+
+ [ '' != bar -a '' = '' ]
+0:strings with `[' builtin
+
+ [ `echo 0` -lt `echo 1` ]
+0:substituion in `[' builtin
diff --git a/Test/11glob.ztst b/Test/11glob.ztst
index 17c33eb63..f5819595b 100644
--- a/Test/11glob.ztst
+++ b/Test/11glob.ztst
@@ -1,8 +1,22 @@
# Tests for globbing
%prep
+ mkdir glob.tmp
+ mkdir glob.tmp/dir1
+ mkdir glob.tmp/dir2
+ : >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
@@ -234,3 +248,8 @@
>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
diff --git a/Test/53completion.ztst b/Test/53completion.ztst
index 00f1c9218..2e33412d8 100644
--- a/Test/53completion.ztst
+++ b/Test/53completion.ztst
@@ -1,7 +1,10 @@
# Tests for completion system.
%prep
+ zmodload -i zsh/zpty
+ TERM=vt100
+ export ZTST_testdir ZTST_srcdir TERM
comptest () { $ZTST_testdir/../Src/zsh -f $ZTST_srcdir/comptest -z $ZTST_testdir/../Src/zsh -d $ZTST_testdir/compdump.tmp "$@" }
mkdir comp.tmp
@@ -104,11 +107,11 @@
>DESCRIPTION:{desc1}
>NO:{arg1}
-# code='compdef _tst tst; _tst () { _arguments "-\+[opt]" }'
-# comptest -c "$code" $'tst -\C-D'
-#0:_arguments
-#>DESCRIPTION:{option}
-#>NO:{-+ -- opt}
+ code='compdef _tst tst; _tst () { _arguments "-\+[opt]" }'
+ comptest -c "$code" $'tst -\C-D'
+0:_arguments
+>DESCRIPTION:{option}
+>NO:{-+ -- opt}
code='compdef _tst tst; _tst () { _arguments "1:desc1:(arg1)" }'
comptest -c "$code" $'tst \t'