zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: tests for trap problems
@ 2000-05-04 11:27 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2000-05-04 11:27 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-05-04 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-04 11:27 PATCH: tests for trap problems Peter Stephenson

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).