about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2020-01-29 08:30:13 +0000
committerDaniel Shahaf <danielsh@apache.org>2020-01-29 08:30:47 +0000
commitb4996ea5ebdfda1b07bae83be64eaa1ef21baa6d (patch)
treeb22991064aed7b60bedc7f6b100f9feaaa0a5bf9
parentbcd78756c8d55b1bab3a9f6fa79eb58782d3000e (diff)
downloadzsh-b4996ea5ebdfda1b07bae83be64eaa1ef21baa6d.tar.gz
zsh-b4996ea5ebdfda1b07bae83be64eaa1ef21baa6d.tar.xz
zsh-b4996ea5ebdfda1b07bae83be64eaa1ef21baa6d.zip
45342: Add tests for interaction between autoloadable parameters and module loading.
-rw-r--r--ChangeLog5
-rw-r--r--Test/V01zmodload.ztst41
2 files changed, 46 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8285bc49c..b14bb3e3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-29  Daniel Shahaf  <danielsh@apache.org>
+
+	* 45342: Test/V01zmodload.ztst: Add tests for interaction
+	between autoloadable parameters and module loading.
+
 2020-01-17  Daniel Shahaf  <danielsh@apache.org>
 
 	* 45313: Completion/Unix/Command/_git: Support completion from
diff --git a/Test/V01zmodload.ztst b/Test/V01zmodload.ztst
index 1bd8c1900..237b7d2dc 100644
--- a/Test/V01zmodload.ztst
+++ b/Test/V01zmodload.ztst
@@ -348,6 +348,47 @@
 ?(eval):6: unknown function: systell
 ?(eval):9: file descriptor out of range
 
+ $ZTST_testdir/../Src/zsh -fc '
+   if zmodload -e zsh/parameter; then zmodload -u zsh/parameter; fi
+   unset options
+   zmodload zsh/parameter
+   echo $+options
+ '
+-f:can unset a non-readonly autoloadable parameter before loading the module
+>0  
+# Currently prints '1'.
+
+ $ZTST_testdir/../Src/zsh -fc '
+   zmodload zsh/parameter
+   unset options
+   echo $+options
+ '
+0:can unset a non-readonly autoloadable parameter after loading the module
+>0  
+
+ $ZTST_testdir/../Src/zsh -fc '
+   if zmodload -e zsh/parameter; then zmodload -u zsh/parameter; fi
+   unset builtins
+ '
+-f:can't unset a readonly autoloadable parameter before loading the module
+*?zsh:?: read-only variable: builtins
+# Currently, the 'unset' succeeds.
+
+ $ZTST_testdir/../Src/zsh -fc '
+   zmodload zsh/parameter
+   unset builtins
+ '
+1:can't unset a readonly autoloadable parameter after loading the module
+?zsh:3: read-only variable: builtins
+
+ $ZTST_testdir/../Src/zsh -fc '
+   zmodload zsh/parameter
+   zmodload -u zsh/parameter
+   echo $options
+ '
+0:unloading a module doesn't implicitly unset autoloadable parameters
+*>(on|off) *  
+
 %clean
 
  eval "$deps"