diff options
author | Bart Schaefer <schaefer@ipost.com> | 2021-04-18 13:58:09 -0700 |
---|---|---|
committer | Bart Schaefer <schaefer@ipost.com> | 2021-04-18 13:58:09 -0700 |
commit | 82ff9f24f170eea7daa935fdaa09ab75a2f277ff (patch) | |
tree | cef3fef19fbe032466fcfbe50b7b6aa0878300a5 /Test/E01options.ztst | |
parent | 56ccb4a975bc87dd10bbbd6a1cfc296d6e2203b4 (diff) | |
download | zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.tar.gz zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.tar.xz zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.zip |
48560: add TYPESET_TO_UNSET option to remove initialization of parameters
Changes typeset such that ${newparam-notset} yields "notset" and "typeset -p newparam" does not show an assignment to the parameter. This is similar to the default behavior of bash and ksh, with minor differences in typeset output. Also add tests for some POSIX incompatibilities plus minor changes for test harness robustness.
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r-- | Test/E01options.ztst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst index 415f46cd7..72749e6ab 100644 --- a/Test/E01options.ztst +++ b/Test/E01options.ztst @@ -1451,3 +1451,18 @@ F:If this test fails at the first unsetopt, refer to P01privileged.ztst. 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='' |