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 1inRAe-0002hr-JS for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jan 2020 17:55:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1inRAd-0005uS-Fh for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jan 2020 17:55:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1inRAd-0005uL-7C for pgsql-hackers@lists.postgresql.org; Fri, 03 Jan 2020 17:55:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1inRAW-0004et-RJ for pgsql-hackers@postgresql.org; Fri, 03 Jan 2020 17:55:34 +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 003HtNCW027521; Fri, 3 Jan 2020 12:55:23 -0500 From: Tom Lane To: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) cc: Christoph Berg , PostgreSQL Hackers Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic. In-reply-to: <87o8vk1n2u.fsf@wibble.ilmari.org> References: <20200103110128.GA28967@msg.df7cb.de> <14261.1578060227@sss.pgh.pa.us> <87o8vk1n2u.fsf@wibble.ilmari.org> Comments: In-reply-to ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) message dated "Fri, 03 Jan 2020 17:12:09 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27519.1578074123.1@sss.pgh.pa.us> Date: Fri, 03 Jan 2020 12:55:23 -0500 Message-ID: <27520.1578074123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Tom Lane writes: >> Anybody know an easy way to do that in Perl? > I was going to suggest using Test::More's like() function to do the > regex check, but sadly that only escapes things that would break the TAP > stream syntax, not non-printables in general. The next obvious thing is > Data::Dumper with the 'Useqq' option enabled, which makes it use > double-quoted-string escapes (e.g. "\a" for ^G). > The attaced patch does that, and also bumps $Test::Builder::Level so the > diagnostic references the calling line, and uses diag() instad of > note(), so it shows even in non-verbose mode. LGTM, pushed (along with a fix to deal with what hopefully is the only remaining obstacle for Andres' critters). regards, tom lane