From b8ae885ab8252f37b149472c288cf0d1c812324d Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 25 Aug 2008 17:28:13 +0000 Subject: 25532: problem skipping assignments etc. with setopt ERREXIT --- Test/C03traps.ztst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Test/C03traps.ztst') diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index b663e296f..1e0b4088f 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -415,6 +415,20 @@ >3 three >5 five + # Assignments are a special case, since they use a simpler + # wordcode type, so we need to test skipping them separately. + fn() { + setopt localtraps localoptions debugbeforecmd + trap '(( LINENO == 4 )) && setopt errexit' DEBUG + x=three + x=four + print $LINENO $x + [[ -o errexit ]] && print "Hey, ERREXIT is set!" + } + fn +1:Skip assignment from DEBUG trap +>5 three + %clean rm -f TRAPEXIT -- cgit 1.4.1