From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7730 invoked by alias); 5 Jun 2014 05:37:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32711 Received: (qmail 5802 invoked from network); 5 Jun 2014 05:37:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140604223723.ZM22960@torch.brasslantern.com> Date: Wed, 04 Jun 2014 22:37:23 -0700 In-reply-to: <140603191227.ZM28198@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Oddball output from zerrmsg()" (Jun 3, 7:12pm) References: <140603191227.ZM28198@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: [PATCH] Re: Oddball output from zerrmsg() MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 3, 7:12pm, Bart Schaefer wrote: } } Now for the strange part. I applied a small patch to doshfunc() to } implement the proposed behavior and ran "make check". I got exactly } one failure ... which then caused additional tests that would have failed, never to be attempted ... } and it's a false positive: } } ============ } ./A07control.ztst: starting. } *** /tmp/zsh.ztst.err.64460 Tue Jun 3 18:57:24 2014 } --- /tmp/zsh.ztst.terr.64460 Tue Jun 3 18:57:24 2014 } *************** } *** 1 **** } ! fn:continue:1 not in while, until, select, or repeat loop } --- 1 ---- } ! fn:continue:1: not in while, until, select, or repeat loop } Test ./A07control.ztst failed: error output differs from expected as shown } above for: } fn() { } continue } } } fn } Was testing: continue outside loop } ./A07control.ztst: test failed. } ============ } } What? Where did the colon after the line number in the error message go? } Why has it not been there all along? I don't see the code path by which } that colon would ever have been omitted, yet A07control.ztst clearly was } not prepared for it to be there. Any ideas? Tracked this down. It turns out this test has never worked, because the "continue" propagates up through the dynamic scopes and restarts the "while true;" loop way up in ZTST_test itself, despite the "eval" in ZTST_execchunk; so nothing ever has a chance to look at whether the actual stderr matches the expected. Not even an "always" block can intercept this, which is probably a bug in the handling of "always". So it's not that the ":" is somehow missing from the output, it's that the expected output has been wrong all along but is simply never seen. diff --git a/Test/A07control.ztst b/Test/A07control.ztst index b9b89b5..397a821 100644 --- a/Test/A07control.ztst +++ b/Test/A07control.ztst @@ -23,12 +23,12 @@ >start 255 >255 - fn() { + $ZTST_testdir/../Src/zsh -fc 'fn() { continue } - fn + fn' 1:continue outside loop -?fn:continue:1 not in while, until, select, or repeat loop +?fn:continue:1: not in while, until, select, or repeat loop for outer in 0 1 2 3; do print outer $outer