From: | ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker ) |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Christoph Berg <myon(at)debian(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pgsql: Add basic TAP tests for psql's tab-completion logic. |
Date: | 2020-01-03 17:12:09 |
Message-ID: | 87o8vk1n2u.fsf@wibble.ilmari.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-hackers |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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
Attachment | Content-Type | Size |
---|---|---|
0001-Escape-non-printable-characters-in-psql-tab-completi.patch | text/x-diff | 1.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-01-03 17:35:30 | Re: pgsql: Add basic TAP tests for psql's tab-completion logic. |
Previous Message | Christoph Berg | 2020-01-03 17:02:26 | Re: pgsql: Add basic TAP tests for psql's tab-completion logic. |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-01-03 17:35:30 | Re: pgsql: Add basic TAP tests for psql's tab-completion logic. |
Previous Message | Christoph Berg | 2020-01-03 17:02:26 | Re: pgsql: Add basic TAP tests for psql's tab-completion logic. |