From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4648 invoked by alias); 9 Feb 2014 22:36:34 -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: 32373 Received: (qmail 5147 invoked from network); 9 Feb 2014 22:36:18 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1391985012; bh=2++JIXzdlkDob6arVaaUcbKkc2pzuc40qRYEzQoqDl8=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=PoK1pKFnNXDePL76fdM+LsAIPXxS5tsdLSYBGxyZjLc2GGckr1WEIUDaOqiJr9D4z5Pgo1SqbqH4eHkbDKExWjtZcUGpqjFS9xk+e6GyO4bSwP2np0W2+vMh9nXf1WMQayqxTH/W72D+xo0en2k5y1kUgfR6WZL5KQZ4pbKfr1s= X-Yahoo-Newman-Id: 993408.81789.bm@smtp116.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 5Quzj1QVM1lPcYLUD4cTFJyY3z5tHDRLlELW9EoHqGF5SPX PwK.Nucz4CVCRUaUJWsDVWv73s.oBogfEicjHZsaG6RuNrLcBrOui_EGNxVx k0rhDQHOTSrFuafyWS5Cr.BUfNTb6GzP3EpWO9z5WcljTHQyJFtKcSBvcxbq j_PF8bII89dmdiNV9A6fZOKF30Qz77aQ8orLCs3OeIOKKGpDQ_aIPA8HS_aj M7h25dXbukV.hs1I8KwCiLjPo8gdo1nZvRbrDoo14QLu0uKvMLpPeKYRG32C Tcfq7yTSU1K1ZfVjCVbVaj.hiwT67.JdRY8Gm17fX0gk6IwQ4Ut_vs6Hpb48 YDPsZVYYCkKhsDOIZwffoFHGpe6sn.SfkvlahzI1euiA5pvfJAgT8QoeeNjw 824XxffJRLBOsYW63Z0N32q.2S7j7FLWwBx9YYPkVLrgpY1ElirV_8DPzElr _D9raO8kdA4qx6hpy2sAZTwBUECNOrr23TcPsk9lduvNtKBFC5_nMAIai5H. zK9IFLCk4NWlKVjdZOKa1ZqMaIQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-Rocket-Received: from kiddle.eu (okiddle@5.146.58.100 with plain [188.125.69.59]) by smtp116.mail.ir2.yahoo.com with SMTP; 09 Feb 2014 22:30:12 +0000 UTC In-reply-to: <140209105343.ZM24252@torch.brasslantern.com> From: Oliver Kiddle References: <140208121311.ZM14905@torch.brasslantern.com> <140208144555.ZM16333@torch.brasslantern.com> <140209105343.ZM24252@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: Commit 137b15a fails X02zlevi test Date: Sun, 09 Feb 2014 23:30:11 +0100 Message-ID: <17919.1391985011@quattro> Bart wrote: > I've been repeatedly running > > make check TESTNUM=X02 > > and have decided that it fails nondeterministically. Sometimes the On my desktop it never seems to fail. I just tried on my NAS box and it appears to reliably fail there. I don't think the send-break is an issue because the combination of kill-buffer and accept-line also exhibit the problem. For the test to be relevant, it needed a new line. The problem seems somewhat similar to the problems I have with Felix's incremental search tests except that is failing more consistently for me. I've attached my modified patch for them in case it provides you with any clues. They seem to always fail on tests that would produce a "failing bck-i-search". I'm fairly stuck on trying to understand that too. Probably need to try to trace the zsh instance that's running under zpty. Oliver diff --git a/Test/X01isearch.ztst b/Test/X01isearch.ztst new file mode 100644 index 0000000..d683242 --- /dev/null +++ b/Test/X01isearch.ztst @@ -0,0 +1,167 @@ +%prep + if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then + . $ZTST_srcdir/comptest + mkdir zle.tmp + cd zle.tmp + print -lr date 'echo xyz three' 'echo xyz two' 'echo 123 abc' \ + 'echo abc abcdef' 'echo abc' 'echo xyz' 'echo date' "echo '*OH NO*'" \ + "echo '\n'" 'echo "*WHAT?*"' > historyX01 + comptestinit -z $ZTST_testdir/../Src/zsh + else + ZTST_unimplemented="the zsh/zpty module is not available" + fi + +%test +# Tests to add: +# case-insesitivity +# ignoring duplicate lines +# special keys + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabc' +0q:Verify incremental search first match +>echo abc +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabcd\C-H' +0q:Verify incremental search first match via backspace +>echo abc +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\n\C-Rabc\C-R' +0q:Verify incremental search second match +>echo abc abcdef +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabc\C-R\C-R' +0q:Verify incremental search third match +>echo abc abcdef +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabc\C-R\C-R\C-R' +0q:Verify incremental search fourth match +>echo 123 abc +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabc\C-R\C-R\C-R\C-R' +0q:Verify incremental search failed fifth match +>echo 123 abc +>failing bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabc\C-R\C-R\C-Rd' +0q:Verify incremental search pass something +>echo 123 abc +>failing bck-i-search: abcd_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabc\C-R\C-R\C-Rd\C-H\C-H\C-Hd' +0q:Verify incremental search pass, backup, and find again. +>echo abc abcdef +>bck-i-search: abcd_ + + comptesteval 'fc -R historyX01' + termtest $'\C-Rabcd\C-T' +0q:Verify incremental search pass, then use search forward to find. +>echo abc abcdef +>fwd-i-search: abcd_ + + comptesteval 'fc -R historyX01' + termtest $'\C-R^date' +0q:Verify incremental search bol pattern +>date +>bck-i-search: ^date_ + + comptesteval 'fc -R historyX01' + termtest $'\C-R\\' +0q:Verify incremental search backslash +>echo '\n' +>bck-i-search: \_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XR\\*' +0q:Verify incremental search backslash star +>echo "*WHAT?*" +>bck-i-search: \*_ + +############# incremental pattern search + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabc' +0q:Verify incremental pattern search first match +>echo abc +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabcd\C-H' +0q:Verify incremental pattern search first match via backspace +>echo abc +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\n\C-XRabc\C-XR' +0q:Verify incremental pattern search second match +>echo abc abcdef +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabc\C-XR\C-XR' +0q:Verify incremental pattern search third match +>echo abc abcdef +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabc\C-XR\C-XR\C-XR' +0q:Verify incremental pattern search fourth match +>echo 123 abc +>bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabc\C-XR\C-XR\C-XR\C-XR' +0q:Verify incremental pattern search failed fifth match +>echo 123 abc +>failing bck-i-search: abc_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabc\C-XR\C-XR\C-XRd' +0q:Verify incremental pattern search pass something +>echo 123 abc +>failing bck-i-search: abcd_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabc\C-XR\C-XR\C-XRd\C-H\C-H\C-Hd' +0q:Verify incremental pattern search pass, backup, and find again. +>echo abc abcdef +>bck-i-search: abcd_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XRabcd\C-XT' +0q:Verify incremental pattern search pass, then use search forward to find. +>echo abc abcdef +>fwd-i-search: abcd_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XR^date' +0q:Verify incremental pattern search bol pattern +>date +>bck-i-search: ^date_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XR\\' +0q:Verify incremental pattern search backslash +>echo '\n' +>bck-i-search: \_ + + comptesteval 'fc -R historyX01' + termtest $'\C-XR\\*' +0q:Verify incremental pattern search backslash star +>echo "*WHAT?*" +>bck-i-search: \*_ + +%clean + zmodload -ui zsh/zpty diff --git a/Test/comptest b/Test/comptest index f1c5af0..8a11ca9 100644 --- a/Test/comptest +++ b/Test/comptest @@ -18,10 +18,10 @@ comptestinit () { done (( OPTIND > 1 )) && shift $(( OPTIND - 1 )) - export PS1="" + export PS1="" PS2="" RPS1="" RPS2="" zpty zsh "$comptest_zsh -f +Z" - zpty -r zsh log1 "**" || { + zpty -r zsh log1 "**" || { print "first prompt hasn't appeared." return 1 } @@ -32,6 +32,7 @@ comptestinit () { "export ZDOTDIR=$ZTST_testdir" \ "module_path=( $module_path )" \ "fpath=( $fpath )" \ +"zle_highlight=(bg_start_code:'\' fg_start_code:'\' isearch:bg=1,fg=2)" \ "bindkey -$comptest_keymap" \ 'LISTMAX=10000000 stty 38400 columns 80 rows 24 @@ -62,6 +63,14 @@ list-choices-with-report () { zle clear-screen zle -R } +tcfunc() { + if [[ -n $2 ]]; then + REPLY="" + else + REPLY="" + fi +} +zle -T tc tcfunc comp-finish () { print "" zle kill-whole-line @@ -73,18 +82,30 @@ zle-finish () { (( region_active )) && print -lr "MARK: $MARK" zle -K main zle clear-screen + zle -R zle send-break +} +term-finish () { + zle kill-buffer + zle clear-screen + print "" zle -R } zle -N expand-or-complete-with-report zle -N list-choices-with-report zle -N comp-finish +zle -N term-finish zle -N zle-finish bindkey "^I" expand-or-complete-with-report bindkey "^D" list-choices-with-report -bindkey "^Z" comp-finish -bindkey "^M" zle-finish -bindkey -a "^M" zle-finish +bindkey "^T" history-incremental-search-forward +bindkey "^XR" history-incremental-pattern-search-backward +bindkey "^XT" history-incremental-pattern-search-forward +bindkey -r "^M" +bindkey "^Mc" comp-finish +bindkey "^Mt" term-finish +bindkey "^Mz" zle-finish +bindkey -a "^Mz" zle-finish ' } @@ -102,7 +123,7 @@ comptesteval () { comptest () { input="$*" - zpty -n -w zsh "$input"$'\C-Z' + zpty -n -w zsh "$input"$'\C-Mc' zpty -r -m zsh log "***" || { print "failed to invoke finish widget." return 1 @@ -136,10 +157,26 @@ comptest () { zletest () { input="$*" - zpty -n -w zsh "$input"$'\C-M' + zpty -n -w zsh "$input"$'\C-Mz' zpty -r -m zsh log "***" || { print "failed to invoke finish widget." return 1 } print -lr "${(@)${(ps:\r\n:)log##*}[1,-2]}" } + +termtest () { + input="$*" + zpty -n -w zsh "$input" + # clear screen, to clear out control sequences + zpty -n -w zsh $'\C-L' + # send trailing output to scrape off. + zpty -n -w zsh $'\C-Mt\C-U' + zpty -r -m zsh log "**" || { + print "failed to invoke finish widget." + return 1 + } + # there might be multiple 's in log, grab the last one + # generated after the clear screen. + print -lr -- ${${(f)${log%%*}##*}%%*} +}