summaryrefslogtreecommitdiff
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst64
1 files changed, 58 insertions, 6 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index cfe2c75cc..72749e6ab 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -57,7 +57,6 @@
# PROMPT_CR
# PUSHD_SILENT
# REC_EXACT
-# RM_STAR_SILENT
# RM_STAR_WAIT
# SHARE_HISTORY
# SINGLE_LINE_ZLE
@@ -92,6 +91,9 @@
catpath=$(which cat)
lspath==ls
+ # If the module fails to load, individual test points will skip.
+ zmodload zsh/zpty 2>/dev/null || true
+
%test
# setopt should move on to the next operation in the face of an error, but
@@ -1109,15 +1111,22 @@ F:Regression test for workers/41811
eval 'for f (word1 word2) print $f'
eval 'repeat 3 print nonsense'
}
- unsetopt shortloops
- print option unset
+ unsetopt shortloops shortrepeat
+ print shortloops and shortrepeat unset
+ fn
+ setopt shortrepeat
+ print shortrepeat set
fn
setopt shortloops
- print option set
+ print shortloops set
fn
0:SHORT_LOOPS option
->option unset
->option set
+>shortloops and shortrepeat unset
+>shortrepeat set
+>nonsense
+>nonsense
+>nonsense
+>shortloops set
>foo
>bar
>word1
@@ -1128,6 +1137,8 @@ F:Regression test for workers/41811
?(eval):1: parse error near `print'
?(eval):1: parse error near `print'
?(eval):1: parse error near `print'
+?(eval):1: parse error near `print'
+?(eval):1: parse error near `print'
fn() { print -l $*; }
setopt shwordsplit
@@ -1414,3 +1425,44 @@ F:If this test fails at the first unsetopt, refer to P01privileged.ztst.
(( UID == EUID ))
fi
0:PRIVILEGED sanity check: default value is correct
+
+ if zmodload -e zsh/zpty 2>/dev/null; then
+ for target_dir target_pattern in \
+ '.' '*' \
+ '/' '/*'
+ do
+ before=`ls -a -- $target_dir`
+ zpty subshell $ZTST_testdir/../Src/zsh -f +Z
+ [[ $PWD == */options.tmp ]] || return 1 # Sanity check before calling rm(1).
+ zpty -w subshell 'PS1=PROMPT'
+ zpty -r -m subshell REPLY $'*PROMPT'
+ zpty -w subshell "rm $target_pattern"
+ zpty -w -n subshell 'n'
+ sleep 1
+ zpty -rt subshell REPLY && print -r -- ${REPLY%%$'\r\n'}
+ zpty -d subshell
+ after=`ls -a -- $target_dir`
+ [[ $before == $after ]] || return 1
+ done
+ else
+ ZTST_skip="the zsh/zpty module is not available"
+ fi
+ BEL=$'\a'
+0q:RM_STAR_SILENT
+*>zsh: sure you want to delete all 15 files in ${PWD:h}/options.tmp \[yn\]\? ${BEL}(|n)
+*>zsh: sure you want to delete (all <->|more than <->) files in / \[yn\]\? ${BEL}(|n)
+
+ () {
+ local var
+ print ${(t)var}
+ }
+0:(t) returns correct type
+>scalar-local
+
+ () {
+ readonly var
+ typeset -p var
+ }
+0:readonly with typeset -p
+F:compare E03posix.ztst
+>typeset -r var=''