Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ilKwj-00084f-1y for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Dec 2019 22:52:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ilKwh-0003BN-I1 for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Dec 2019 22:52:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ilKwh-0003BG-64 for pgsql-hackers@lists.postgresql.org; Sat, 28 Dec 2019 22:52:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ilKwa-0000qv-Eo for pgsql-hackers@lists.postgresql.org; Sat, 28 Dec 2019 22:52:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBSMqEKC007905; Sat, 28 Dec 2019 17:52:14 -0500 From: Tom Lane To: Fabien COELHO cc: PostgreSQL Developers Subject: Re: TAP testing for psql's tab completion code In-reply-to: References: <10967.1577562752@sss.pgh.pa.us> Comments: In-reply-to Fabien COELHO message dated "Sat, 28 Dec 2019 22:16:52 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7903.1577573534.1@sss.pgh.pa.us> Date: Sat, 28 Dec 2019 17:52:14 -0500 Message-ID: <7904.1577573534@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fabien COELHO writes: >> We've often talked about the problem that we have no regression test >> coverage for psql's tab completion code. I got interested in this >> issue while messing with the filename completion logic therein [1], >> so here is a draft patch that adds some testing for that code. > After you raised the issue, I submitted something last August, which did > not attract much attention. > https://commitfest.postgresql.org/26/2262/ > It covers some tab-completion stuff. It uses Expect for the interactive > stuff (tab completion, \h, ...). Now that you mention it, I seem to recall looking at that and not being happy with the additional dependency on Expect. Expect is *not* a standard module; on the machines I have handy, the only one in which it appears in the default Perl installation is macOS. (Huh, what's Apple doing out ahead of the pack?) I'm pretty sure that Expect also relies on IO::Pty, so it's a strictly worse dependency than what I've got here. Can we recast what you did into something like this patch's methods? regards, tom lane