zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Damn race conditions ...
Date: Tue, 18 Mar 2014 18:36:09 +0900	[thread overview]
Message-ID: <CD0F860B-3B7C-4A5D-A0D3-528D45058079@kba.biglobe.ne.jp> (raw)
In-Reply-To: <140317174721.ZM30317@torch.brasslantern.com>


On 2014/03/18, at 9:47, Bart Schaefer <schaefer@brasslantern.com> wrote:
> OF course it's not consistent WHERE it failes, so patching any one test
> is not likely to help.  E.g., in this most recent try the failure is
> here:

Are failures always at tests with comptesteval?

comptesteval uses '. $tmp' for executing commands in a
file $tmp by the slave zsh, but the '.' (or source)
would temporarily change the tty mode of the slave zsh
and may cause some trouble ...

It seems we can avoid using comptesteval as in the
patch below. Please git it a try.



diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 60f878e..19188df 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -21,19 +21,19 @@
 >text
 >CURSOR: 8
 
-  comptesteval 'print -z before'
+  zpty_run 'print -z before'
   zletest $'after\e.'
 0:repeat initial edit with non-blank starting line
 >BUFFER: beforeafterafter
 >CURSOR: 15
 
-  comptesteval 'setopt overstrike;print -z bung'
+  zpty_run 'setopt overstrike;print -z bung'
   zletest $'ing\e2|.'
 0:repeat initial edit with overstrike set
 >BUFFER: binging
 >CURSOR: 3
 
-  comptesteval 'bindkey "^_" undo'
+  zpty_run 'bindkey "^_" undo'
   zletest $'undoc\037e'
 0:use of undo in vi insert mode
 >BUFFER: undoe
@@ -49,19 +49,19 @@
 >BUFFER: z
 >CURSOR: 1
 
-  comptesteval 'bindkey -a "^K" redo'
+  zpty_run 'bindkey -a "^K" redo'
   zletest $'123\C-_\e\C-k'
 0:undo in insert mode, redo in command
 >BUFFER: 123
 >CURSOR: 2
 
-  comptesteval 'bindkey "^Y" redo'
+  zpty_run 'bindkey "^Y" redo'
   zletest $'pre\eA123\C-_\C-y\eu'
 0:undo and redo in insert mode, undo in command
 >BUFFER: pre
 >CURSOR: 2
 
-  comptesteval 'bindkey "^Gu" split-undo'
+  zpty_run 'bindkey "^Gu" split-undo'
   zletest $'one\C-gutwo\eu'
 0:split the undo sequence
 >BUFFER: one
diff --git a/Test/comptest b/Test/comptest
index 48b6cdf..4655f3b 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -102,6 +102,14 @@ zpty_flush() {
   fi
 }
 
+zpty_run() {
+  zpty -w zsh "$*"
+  zpty -r -m zsh log "*<PROMPT>*" || {
+    print "prompt hasn't appeared."
+    return 1
+  }
+}
+
 comptesteval () {
   local tmp=/tmp/comptest.$$
 




  reply	other threads:[~2014-03-18  9:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-16 21:15 Bart Schaefer
2014-03-17 13:54 ` Jun T.
2014-03-18  0:47   ` Bart Schaefer
2014-03-18  9:36     ` Jun T. [this message]
2014-03-18 17:06       ` Bart Schaefer

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=CD0F860B-3B7C-4A5D-A0D3-528D45058079@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --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).