about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-05-08 12:53:18 +0100
committerPeter Stephenson <pws@zsh.org>2015-05-08 12:53:18 +0100
commitf855801fb9ed82d2596f52f5b64dd66c42255c5f (patch)
tree84382c37594d79af18aae28d45a3cd37747a14c8 /Test
parent39aeeedb19744bc5250def0404b1ceca1c3aed0f (diff)
downloadzsh-f855801fb9ed82d2596f52f5b64dd66c42255c5f.tar.gz
zsh-f855801fb9ed82d2596f52f5b64dd66c42255c5f.tar.xz
zsh-f855801fb9ed82d2596f52f5b64dd66c42255c5f.zip
35059: fix, document, test readonly -p.
Don't output specials as can't be reconstructed.

Output arrays in a useful order.
Diffstat (limited to 'Test')
-rw-r--r--Test/B02typeset.ztst21
1 files changed, 21 insertions, 0 deletions
diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst
index 2edbb0b5e..57a7caa12 100644
--- a/Test/B02typeset.ztst
+++ b/Test/B02typeset.ztst
@@ -487,3 +487,24 @@
 ?typeset -r pbro
 ?0
 ?(eval):10: read-only variable: pbro
+
+  readonly foo=bar novalue
+  readonly -p
+0:readonly -p output (no readonly specials)
+>typeset -r foo=bar
+>typeset -r novalue=''
+
+  local -a a1 a2
+  local -r r1=yes r2=no
+  a1=(one two) a2=(three four)
+  readonly a1
+  typeset -pm 'a[12]'
+  typeset -pm 'r[12]'
+0:readonly -p output
+>typeset -a a1
+>a1=(one two)
+>typeset -ar a1
+>typeset -a a2
+>a2=(three four)
+>typeset -r r1=yes
+>typeset -r r2=no