zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: tests for trap problems
Date: Thu, 04 May 2000 12:27:07 +0100	[thread overview]
Message-ID: <0FU100FN89577H@la-la.cambridgesiliconradio.com> (raw)

This tests for the two trap problems we had recently, TRAPZERR triggering
too often and localtraps causing a crash --- that's why I'm using `unset -f
TRAPZERR' as in the problem seen, rather than the more usual `trap -
ZERR'.

Maybe we need an option to recognise ERR as an alias for ZERR on machines
which don't have a SIGERR.

Index: Test/08traps.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/08traps.ztst,v
retrieving revision 1.2
diff -u -r1.2 08traps.ztst
--- Test/08traps.ztst	2000/04/30 14:48:50	1.2
+++ Test/08traps.ztst	2000/05/04 11:24:12
@@ -148,3 +148,30 @@
 >end of fn
 >finish
 
+  TRAPZERR() { print 'ERR-or!'; }
+  f() { print f; false; }
+  t() { print t; }
+  f
+  f && t
+  t && f && true
+  t && f
+  testunset() {
+    setopt localtraps
+    unset -f TRAPZERR
+    print testunset
+    false
+    true
+  }
+  testunset
+  f
+1: more sophisticated error trapping
+>f
+>ERR-or!
+>f
+>t
+>t
+>f
+>ERR-or!
+>testunset
+>f
+>ERR-or!

-- 
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


                 reply	other threads:[~2000-05-04 11:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0FU100FN89577H@la-la.cambridgesiliconradio.com \
    --to=pws@cambridgesiliconradio.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).