zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: [PATCH] Re: Oddball output from zerrmsg()
Date: Wed, 04 Jun 2014 22:37:23 -0700	[thread overview]
Message-ID: <140604223723.ZM22960@torch.brasslantern.com> (raw)
In-Reply-To: <140603191227.ZM28198@torch.brasslantern.com>

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


  reply	other threads:[~2014-06-05  5:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04  2:12 Bart Schaefer
2014-06-05  5:37 ` Bart Schaefer [this message]
2014-06-05 15:53   ` break/continue vs. try-always Bart Schaefer
2014-06-06 20:58     ` Peter Stephenson
2014-06-06 21:08       ` Bart Schaefer
2014-06-06 21:45         ` Peter Stephenson
2014-06-07  6:22           ` Bart Schaefer
2014-06-08 17:54             ` Peter Stephenson
2014-06-08 18:41               ` Bart Schaefer
2014-06-08 19:43                 ` Peter Stephenson
2014-06-08 20:29                   ` Peter Stephenson
2014-06-08 21:01                   ` Bart Schaefer
2014-06-08 21:50                     ` Peter Stephenson
2014-06-09  2:11                       ` Bart Schaefer
2014-06-12 19:35                         ` Peter Stephenson
2014-06-13  6:57                           ` Bart Schaefer
2014-06-13  9:55                             ` Peter Stephenson

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=140604223723.ZM22960@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).