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 1hjRNr-0008RR-Ls for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jul 2019 16:48:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hjRNp-0008TO-9Q for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jul 2019 16:48:25 +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 1hjRNo-0008G6-Tx for pgsql-hackers@lists.postgresql.org; Fri, 05 Jul 2019 16:48:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjRNh-000782-Gy for pgsql-hackers@postgresql.org; Fri, 05 Jul 2019 16:48:22 +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 x65GmA50028341; Fri, 5 Jul 2019 12:48:10 -0400 From: Tom Lane To: Fabien COELHO cc: David Fetter , Arthur Zakirov , Corey Huinker , PostgreSQL Development Subject: Re: [PATCH v4] Add \warn to psql In-reply-to: References: <20190427171548.GM28936@fetter.org> <20190428145813.GO28936@fetter.org> <20190429041106.GB2954@fetter.org> <20190429141710.GD2954@fetter.org> <10811be6-cd8d-eadb-9b70-7a6e72ed4ee5@gmail.com> <20190501073857.GY28936@fetter.org> <11038.1562098250@sss.pgh.pa.us> <31001.1562162768@sss.pgh.pa.us> Comments: In-reply-to Fabien COELHO message dated "Wed, 03 Jul 2019 16:29:23 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28339.1562345290.1@sss.pgh.pa.us> Date: Fri, 05 Jul 2019 12:48:10 -0400 Message-ID: <28340.1562345290@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fabien COELHO writes: > I agree that using TAP test if another simpler option is available is not > a good move. > However, in the current state, as soon as there is some variation a test > is removed and coverage is lost, but they could be kept if the check could > be against a regexp. I'm fairly suspicious of using TAP tests just to get a regexp match. The thing I don't like about TAP tests for this is that they won't notice if the test case prints extra stuff beyond what you were expecting --- at least, not without care that I don't think we usually take. I've thought for some time that we should steal an idea from MySQL and extend pg_regress so that individual lines of an expected-file could have regexp match patterns rather than being just exact matches. I'm not really sure how to do that without reimplementing diff(1) for ourselves :-(, but that would be a very large step forward if we could find a reasonable implementation. Anyway, my opinion about having TAP test(s) for psql remains that it'll be a good idea as soon as somebody submits a test that adds a meaningful amount of code coverage that way (and the coverage can't be gotten more simply). But we don't need a patch that is just trying to get the camel's nose under the tent. regards, tom lane