pgsql: Add basic TAP tests for psql's tab-completion logic.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add basic TAP tests for psql's tab-completion logic.
Date: 2020-01-02 20:02:29
Message-ID: E1in6ft-0004zR-6l@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Add basic TAP tests for psql's tab-completion logic.

Up to now, psql's tab-complete.c has had exactly no regression test
coverage. This patch is an experimental attempt to add some.

This needs Perl's IO::Pty module, which isn't installed everywhere,
so the test script just skips all tests if that's not present.
There may be other portability gotchas too, so I await buildfarm
results with interest.

So far this just covers a few very basic keyword-completion and
query-driven-completion scenarios, which should be enough to let us
get a feel for whether this is practical at all from a portability
standpoint. If it is, there's lots more that can be done.

Discussion: https://postgr.es/m/10967.1577562752@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7c015045b9141cc30272930ea88cfa5df47240b7

Modified Files
--------------
configure | 2 +
configure.in | 1 +
src/Makefile.global.in | 1 +
src/bin/psql/.gitignore | 2 +-
src/bin/psql/Makefile | 10 +++
src/bin/psql/t/010_tab_completion.pl | 122 +++++++++++++++++++++++++++++++++++
src/test/perl/PostgresNode.pm | 67 +++++++++++++++++++
7 files changed, 204 insertions(+), 1 deletion(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2020-01-02 20:11:08 pgsql: Fix cloning of row triggers to sub-partitions
Previous Message Tom Lane 2020-01-02 19:03:05 pgsql: Fix typmod exposed for scalar function in FROM, too.

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2020-01-02 20:04:27 Re: Recognizing superuser in pg_hba.conf
Previous Message Stephen Frost 2020-01-02 19:52:02 Re: Recognizing superuser in pg_hba.conf