summary refs log tree commit diff
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst10
1 files changed, 9 insertions, 1 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 680f49082..cfe2c75cc 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -74,7 +74,6 @@
 #    HASH_LIST_ALL )
 #    PRINT_EXIT_STATUS   haven't worked out what this does yet, although
 #                        Bart suggested a fix.
-#    PRIVILEGED (similar to GLOBAL_RCS)
 #    RCS        (  "      "    "    " )
 #    SH_OPTION_LETTERS   even I found this too dull to set up a test for
 #    SINGLE_COMMAND      kills shell
@@ -95,6 +94,15 @@
 
 %test
 
+  # setopt should move on to the next operation in the face of an error, but
+  # preserve the >0 return code
+  unsetopt aliases
+  setopt not_a_real_option aliases && return 2
+  print -r - $options[aliases]
+0:setopt error handling
+?(eval):setopt:4: no such option: not_a_real_option
+>on
+
   alias echo='print foo'
   unsetopt aliases
   # use eval else aliases are all parsed at start