From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24360 invoked by alias); 24 Mar 2015 04:12:59 -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: 34772 Received: (qmail 28873 invoked from network); 24 Mar 2015 04:12:47 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=SphKvAtlv4MGHcRz+NxXmcwOW8glO0sDb6jBHxMq9/s=; b=GcgS8xDelqQgTyzxiCSZxYnemzT/vDNvn7QRVDCMCqpo+qVsZGjlaR/KS9YAK6FLqY aO3OOgF7nzFzLoYvx6LXp2JpwA9Lalv0XXIUjx5DPv6PI3DhnC2wba3nEmrRfu+Ul1ye QuwdiiPYvDv3mmVT83MQVmo20w+47JcF0mzFG1ShrZyXl1cen69NNus4gBzyIdL/L6Cd fue24wuuG1tFgaDX3kf+p1eKx9Ed2xXQ3kb/0SFVe0jLJGTjvPay+yQ8hUV8ucvJ/cf9 k43/fx0x9nRKIhz+jt5RIM9Tv1rM7powoYUZ4zoGizM46Gq5BSl6mxdicc1OnOvxFezy OUxg== X-Gm-Message-State: ALoCoQkN7pp0KdSlhcfiqknzbbtiN8bIK8gkBIeYxVHN2w/lcoiRnstMCxVvLBHKaXi6OQrgloEY X-Received: by 10.182.80.103 with SMTP id q7mr1879754obx.18.1427170365274; Mon, 23 Mar 2015 21:12:45 -0700 (PDT) From: Bart Schaefer Message-Id: <150323211241.ZM13580@torch.brasslantern.com> Date: Mon, 23 Mar 2015 21:12:41 -0700 In-Reply-To: <150323175445.ZM32519@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Testing interactive features (Re: capturing output of !! not working)" (Mar 23, 5:54pm) References: <20150319105716.620cd931@pwslap01u.europe.root.pri> <20150319125351.1e270c2d@pwslap01u.europe.root.pri> <20150320105703.2754b6af@pwslap01u.europe.root.pri> <150320090420.ZM21908@torch.brasslantern.com> <20150322183556.1fa0f143@ntlworld.com> <150322162235.ZM1728@torch.brasslantern.com> <20150323213426.21fd79c8@ntlworld.com> <150323175445.ZM32519@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Testing interactive features (Re: capturing output of !! not working) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 23, 5:54pm, Bart Schaefer wrote: } } Since writing it, I noticed that history aggressively directs output } to /dev/tty. I haven't come up with any way to suppress that, and if } you run it without a tty the stderr pattern does not match. } } However, that's not the only test that has problems if there is no tty: } } + not interactive and can't open terminal } + not interactive and can't open terminal } + not interactive and can't open terminal } Test ../../zsh-5.0/Test/X02zlevi.ztst failed: error output differs from Here's a revised Test/W01* that works with no TTY and warns about the output when there is one, plus a patch to comptest for the Test/X01* failure with no TTY. diff --git a/Test/W01history.ztst b/Test/W01history.ztst new file mode 100644 index 0000000..2492c41 --- /dev/null +++ b/Test/W01history.ztst @@ -0,0 +1,19 @@ +# Tests for BANG_HIST replacements + +%prep + + [[ -t 0 ]] && print -u $ZTST_fd History tests write to /dev/tty + +%test + + $ZTST_testdir/../Src/zsh -fis <<<' + echo foo bar + echo $(!!) again + echo more $( !! )' 2>/dev/null +0:Regression test for history references in command substitution +>foo bar +>foo bar again +>more foo bar again +*?* +F:Check that a history bug introduced by workers/34160 is working again. +F:Discarded line of error output consumes prompts printed by "zsh -i". diff --git a/Test/comptest b/Test/comptest index 9c92f96..ef84217 100644 --- a/Test/comptest +++ b/Test/comptest @@ -164,7 +164,7 @@ zletest () { for input; do # zpty_flush Before zletest # sleep for $KEYTIMEOUT - (( first++ )) && read -t 0.011 -k 1 < /dev/null + (( first++ )) && read -t 0.011 -u 0 -k 1 < /dev/null zpty -n -w zsh "$input" done zpty -n -w zsh $'\C-X'