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 1inQUx-000129-Dv for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jan 2020 17:12:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1inQUw-00032a-0A for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jan 2020 17:12:30 +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 1inQUu-00032N-3S for pgsql-hackers@lists.postgresql.org; Fri, 03 Jan 2020 17:12:29 +0000 Received: from [66.111.4.224] (helo=new2-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1inQUp-0004KH-JN for pgsql-hackers@postgresql.org; Fri, 03 Jan 2020 17:12:27 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 9F9836792; Fri, 3 Jan 2020 12:12:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 03 Jan 2020 12:12:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h= from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=fm1; bh=mv/pZ6TOM2S5QwK8PqrO6w817P OSoooRKCbeA10Qcy8=; b=XZuLGjoq/XG3c9gZbpYla2tkezAkBCynp2GuXZsFI3 ptxKlYklpjGGyD5RP3QQrq2Z5kZa6rs5GDPgQqLBqEbvmImVINeUSAjeELeLIwNm Xz4spoUKjv8P8NWPYyfBlWuCMQpaLQWKji3NSYf1ogFSJp9KVHm5v5Zjg24RLD12 rcm/qMXChFexa2hoTuGY4TZ/h3W9EyjosSzgSFSRzSbC+pnQdKZdnTetYhuY0gHa xMIMqsR0NS4CosF/Q3Y5fEtC5gN5+oNQSKnaSQTw53BYj3lLwocRH81vyjtuSbej Ddq1EGniiRkamK+C/KRaHAHhoNYGT7lreqlan68m46qw== 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=mv/pZ6 TOM2S5QwK8PqrO6w817POSoooRKCbeA10Qcy8=; b=BefEI7/jj8oYLG2nq4cK27 n+1s5zlz6myoq4/U5EqcdeSIINEkYMN5ytFr9mzWIUB6ckVuV2ao5qRdQr8JjkIc oHocd9k4ZJTSpkBzKogccd65DoUTEXe64fvD85pCPYvWR8aKyIMXC+HFv/V9Vr6Y cb/PsKlq3gdzRmpItbn/losb0EhK60U+tD+hWo9C99QTXkXwvrV9ed/wz2nK1vaO Y1DGzRWiKzQNMwL6i1Wkbh7+t9gNBbdbadGNwxwRKMrdYaEAskeRcksgw58QOFVq VvTrvVuQdeFgXxFkIf5aQ2nMMyucm8lmXI6WM5CUpCLCw9SzbCDgzKoBpAg0cjSA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdegfedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtsehmtderredtreejnecuhfhrohhmpehilhhmrghr ihesihhlmhgrrhhirdhorhhgucdlffgrghhfihhnnhcukfhlmhgrrhhiucforghnnhhsno hkvghrmdenucfkphepgeeirdegfedrudehrddvhedvnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehilhhmrghrihesihhlmhgrrhhirdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from wibble.ilmari.org (wibble.ilmari.org [46.43.15.252]) by mail.messagingengine.com (Postfix) with ESMTPA id 9F69030607CD; Fri, 3 Jan 2020 12:12:10 -0500 (EST) From: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) To: Tom Lane Cc: Christoph Berg , PostgreSQL Hackers Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic. References: <20200103110128.GA28967@msg.df7cb.de> <14261.1578060227@sss.pgh.pa.us> Date: Fri, 03 Jan 2020 17:12:09 +0000 In-Reply-To: <14261.1578060227@sss.pgh.pa.us> (Tom Lane's message of "Fri, 03 Jan 2020 09:03:47 -0500") Message-ID: <87o8vk1n2u.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.224 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=-=-= Content-Type: text/plain Tom Lane writes: > Also, while I'm asking for Perl advice: I can see in my editor that > there's a control-G bell character in that string, but this is far > from obvious on the web page. I'd kind of like to get the report > to escapify control characters so that what comes out is more like > > # Actual output was "\DRD^G" > or > # Actual output was "\\DRD\007" > > or some such. 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. - ilmari -- "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Escape-non-printable-characters-in-psql-tab-completi.patch