diff options
author | Peter Stephenson <pws@zsh.org> | 2015-04-29 15:54:49 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-04-29 15:54:49 +0100 |
commit | bf258a1c07a9cf1119f83d1d15310b02b94f4d67 (patch) | |
tree | af7f12d596efe96213fd12ed3328e9342fc59107 /Test/B02typeset.ztst | |
parent | c96a993d51e3e5958c8161d0dbe86cb43bcc52c1 (diff) | |
download | zsh-bf258a1c07a9cf1119f83d1d15310b02b94f4d67.tar.gz zsh-bf258a1c07a9cf1119f83d1d15310b02b94f4d67.tar.xz zsh-bf258a1c07a9cf1119f83d1d15310b02b94f4d67.zip |
34992: POSIX fix for readonly variables.
With POSIXBUILTINS, variables can be marked readonly if unset. Also, variables can't have the readonly flag removed.
Diffstat (limited to 'Test/B02typeset.ztst')
-rw-r--r-- | Test/B02typeset.ztst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst index 51ebc6535..f4fb8ecb9 100644 --- a/Test/B02typeset.ztst +++ b/Test/B02typeset.ztst @@ -468,3 +468,20 @@ 0:retying arrays to same array works >foo bar >goo car + + ( + setopt POSIXBUILTINS + readonly pbro + print ${+pbro} >&2 + (typeset pbro=3) + (pbro=4) + typeset -r pbro # idempotent (no error)... + print ${+pbro} >&2 # ...so still readonly... + typeset +r pbro # ...can't turn it off + ) +1:Readonly with POSIX_BUILTINS +?0 +?(eval):5: read-only variable: pbro +?(eval):6: read-only variable: pbro +?0 +?(eval):9: read-only variable: pbro |