about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2024-03-04 21:21:20 -0800
committerBart Schaefer <schaefer@zsh.org>2024-03-04 21:21:20 -0800
commit0848b7534ed918503c36a4b217ab5f6053805763 (patch)
tree6ae395db6de0b0765fb9ada1447515f799473700 /Test
parent700f675bf0dcd89f685b9c87b416ecb2e40e6a55 (diff)
downloadzsh-0848b7534ed918503c36a4b217ab5f6053805763.tar.gz
zsh-0848b7534ed918503c36a4b217ab5f6053805763.tar.xz
zsh-0848b7534ed918503c36a4b217ab5f6053805763.zip
52659: Fix crash on unset-through-nameref, add regression test
Diffstat (limited to 'Test')
-rw-r--r--Test/K01nameref.ztst25
1 files changed, 25 insertions, 0 deletions
diff --git a/Test/K01nameref.ztst b/Test/K01nameref.ztst
index 47d32697c..e45b922e2 100644
--- a/Test/K01nameref.ztst
+++ b/Test/K01nameref.ztst
@@ -711,6 +711,31 @@ F:Checking for a bug in zmodload that affects later tests
 >typeset -n ref=two
 >typeset -n ref=var
 
+ typeset -g .K01.scalar='RW'
+ typeset -gA .K01.assoc=(x y)
+ typeset -ga .K01.array=(z)
+ typeset -gi .K01.integer=0
+ typeset -gE .K01.double=0.0
+ typeset -gF .K01.float=0.0
+ typeset -gr .K01.readonly='RO'
+ typeset -n gref
+ for gref in ARGC .K01.{scalar,assoc,array,integer,double,float,readonly}
+ do
+   { unset gref } always { TRY_BLOCK_ERROR=0 }
+ done
+ typeset -p .K01.{scalar,assoc,array,integer,double,float,readonly}
+ unset .K01.{scalar,assoc,array,integer,double,float}
+0:unset various types via nameref, including a readonly special
+>typeset -g .K01.scalar
+>typeset -g -A .K01.assoc
+>typeset -g -a .K01.array
+>typeset -g -i .K01.integer
+>typeset -g -E .K01.double
+>typeset -g -F .K01.float
+>typeset -g -r .K01.readonly=RO
+*?*read-only variable: ARGC
+*?*read-only variable: .K01.readonly
+
  unset -n ref
  unset one
  typeset -n ref