From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2583 invoked from network); 4 May 2000 11:27:47 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 May 2000 11:27:47 -0000 Received: (qmail 25426 invoked by alias); 4 May 2000 11:27:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11147 Received: (qmail 25413 invoked from network); 4 May 2000 11:27:36 -0000 Date: Thu, 04 May 2000 12:27:07 +0100 From: Peter Stephenson Subject: PATCH: tests for trap problems To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FU100FN89577H@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT 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 Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070