From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining Date: Wed, 19 Jan 2022 13:54:04 -0700 Message-ID: <87o847cuqb.fsf@melete.silentflame.com> References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> <87ft26etuh.fsf@gmx.de> <87tuex1yzo.fsf@melete.silentflame.com> <87czlkbxnh.fsf@gmx.de> <87ee601ey0.fsf@melete.silentflame.com> <871r1yaz36.fsf@gmx.de> <87y245zzjq.fsf@melete.silentflame.com> <83fsqdnc0o.fsf@gnu.org> <87r19xaoqe.fsf@gmx.de> <87o851zwdq.fsf@melete.silentflame.com> <87lf05algc.fsf@gmx.de> <87ilv9zuv4.fsf@melete.silentflame.com> <87fsqd9kch.fsf@gmx.de> <87y23dei2o.fsf@melete.silentflame.com> <87bl07910f.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="481"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 46351@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 19 21:56:00 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAHzr-000AWy-4X for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jan 2022 21:55:59 +0100 Original-Received: from localhost ([::1]:58578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAHzp-00011o-TP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jan 2022 15:55:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAHzF-0000zA-US for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2022 15:55:23 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAHyw-00059l-Du for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2022 15:55:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAHyw-0002uS-Eg for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2022 15:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jan 2022 20:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46351 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46351-submit@debbugs.gnu.org id=B46351.164262565311118 (code B ref 46351); Wed, 19 Jan 2022 20:55:02 +0000 Original-Received: (at 46351) by debbugs.gnu.org; 19 Jan 2022 20:54:13 +0000 Original-Received: from localhost ([127.0.0.1]:55632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAHy9-0002tF-67 for submit@debbugs.gnu.org; Wed, 19 Jan 2022 15:54:13 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAHy7-0002t3-My for 46351@debbugs.gnu.org; Wed, 19 Jan 2022 15:54:12 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 0AF9D32022A6; Wed, 19 Jan 2022 15:54:05 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 19 Jan 2022 15:54:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=XD/8RdMIhODy4bLTkI9jeiW8Pk N95tjS1OiCNw71c7I=; b=gWx6LRQwq6UI7lqcATp9uYmucwsmCQi2AU5AIDap/B vASJfc7qu2cwjSPuLReQlN5Quulph3y3C/6aSGJIQ/haFnz3B3JcBlNsGYs4sTgm TIWvXmUBXW/iYeONwWGbLHbfWhfTo7iuQklRF+UQSeC+dHkn33axqGSM1l8DCKaI NLLi/cGeY9Qb4TFYlN7VVrjIQz7zTgsevg3GhwmPDOYFH9h01U/SrvU24Q8j/tNo 3o3AKn97eCbv8QSrPypZGqIJ/lbabp4q+MxRYU+0+JsAgftU06Fl+WEG53w2cJA8 /gBmvIyCBrUwHHGxSQrmwnGRmhrG/s0m12cuHBU5uDWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=XD/8Rd MIhODy4bLTkI9jeiW8PkN95tjS1OiCNw71c7I=; b=jYQzb9/dAuFh5Hb4QOTKRD klchkXTdlSSKWMxhBuL6gkqaxgViczH75tqAl0zM9+vO1LNbL32yGeGZCpUhgzBy UXRXA2sP412QTnhN3kI9ElX8WEEeardZwqx7KKmwjVpW2b5NsQgZxUkgjEZ0EBUZ jQqbNn+aTTTbYaO0Jc/yFRGoZIEbfcWrcnIvWqkvLJvhZ1HEfkLSVe4HFepHEef7 R7V7tTBbsezINBxmVE5hDMAlU1jDiByeG3NOYgTAkKjpXZ5PDvs0guMLkCDmvmUT m3iWQDFtZdyKX/RlFcc7MiaqxV1/9lHyhkunckKvl1RdP0Ii9KvVFymr8yVNyvUg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeeg feetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jan 2022 15:54:05 -0500 (EST) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 6E20C7E0D6E; Wed, 19 Jan 2022 13:54:04 -0700 (MST) In-Reply-To: <87bl07910f.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224635 Archived-At: Hello Michael, On Wed 19 Jan 2022 at 04:52PM +01, Michael Albinus wrote: >> --- /dev/null >> +++ b/test/lisp/eshell/em-extpipe-tests.el >> @@ -0,0 +1,122 @@ >> +(load (expand-file-name "eshell-tests" >> + (file-name-directory (or load-file-name >> + default-directory)))) > > This is problematic. Loading eshell-tests.el declares also all ert tests > which are contained in that file. Running em-extpipe-tests.el in batch > would run also all tests from that file, which is not intended I believe. > > A better approach would be to factor out the helper functions from > eshell-tests.el into an own file, and load it here and in eshell-tests.el. Good point, I'll factor that out. >> +(cl-macrolet >> + ((deftest (name input expected) >> + (let ((result (gensym))) >> + `(ert-deftest ,name () >> + (let* ((shell-file-name "sh") (shell-command-switch "-c") > > I'm not sure this is the right approach. Why do you change > shell-file-name and shell-command-switch? You've spoken in another > message about Tramp, but I don't understand this. Tramp has its own > machinery to handle them, via connection-local variables. The unit tests are all about seeing whether em-extpipe sets up `eshell-parse-command' to do the right thing. When it comes to shell-file-name and shell-command-switch, however, all em-extpipe does is substitute them in verbatim, using `with-connection-local-variables'. So there isn't much point in varying the values of the two variables in the tests. However, as the values of the two variables show up in the expected return values of `eshell-parse-command' that are part of the test definitions, in order to write the tests, I need to know what those two values will be. It seemed simplest just to bind them to constants. I could instead substitute the actual values of those variables into the expected return values. It seems to me that would sacrifice readability of the tests, though. Am I perhaps missing some other benefit? >> + (deftest em-extpipe-test-7 > > Looks like em-extpipe-test-6 is missing. Oops, will fix. Many thanks for the review. -- Sean Whitton