pgsql: Improve grammar of options for command arrays in TAP tests

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve grammar of options for command arrays in TAP tests
Date: 2025-01-22 05:48:04
Message-ID: E1taTau-002rOj-0G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve grammar of options for command arrays in TAP tests

This commit rewrites a good chunk of the command arrays in TAP tests
with a grammar based on the following rules:
- Fat commas are used between option names and their values, making it
clear to both humans and perltidy that values and names are bound
together. This is particularly useful for the readability of multi-line
command arrays, and there are plenty of them in the TAP tests. Most of
the test code is updated to use this style. Some commands used
parenthesis to show the link, or attached values and options in a single
string. These are updated to use fat commas instead.
- Option names are switched to use their long names, making them more
self-documented. Based on a suggestion by Andrew Dunstan.
- Add some trailing commas after the last item in multi-line arrays,
which is a common perl style.

Not all the places are taken care of, but this covers a very good chunk
of them.

Author: Dagfinn Ilmari Mannsåker
Reviewed-by: Michael Paquier, Peter Smith, Euler Taveira
Discussion: https://postgr.es/m/87jzc46d8u.fsf@wibble.ilmari.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ce1b0f9da03e1cebc293f60b378079b22bd7cc0f

Modified Files
--------------
contrib/basebackup_to_shell/t/001_basic.pl | 30 +-
src/bin/initdb/t/001_initdb.pl | 36 +-
src/bin/pg_amcheck/t/002_nonesuch.pl | 124 +++---
src/bin/pg_amcheck/t/003_check.pl | 122 ++++--
src/bin/pg_amcheck/t/004_verify_heapam.pl | 7 +-
src/bin/pg_amcheck/t/005_opclass_damage.pl | 8 +-
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 408 ++++++++++++-------
src/bin/pg_basebackup/t/011_in_place_tablespace.pl | 10 +-
src/bin/pg_basebackup/t/020_pg_receivewal.pl | 88 ++--
src/bin/pg_basebackup/t/030_pg_recvlogical.pl | 65 +--
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl | 258 ++++++------
src/bin/pg_checksums/t/002_actions.pl | 60 ++-
src/bin/pg_combinebackup/t/002_compare_backups.pl | 36 +-
src/bin/pg_combinebackup/t/003_timeline.pl | 21 +-
src/bin/pg_combinebackup/t/004_manifest.pl | 15 +-
src/bin/pg_combinebackup/t/005_integrity.pl | 81 ++--
src/bin/pg_combinebackup/t/006_db_file_copy.pl | 14 +-
.../pg_combinebackup/t/007_wal_level_minimal.pl | 14 +-
src/bin/pg_combinebackup/t/008_promote.pl | 14 +-
src/bin/pg_combinebackup/t/009_no_full_file.pl | 19 +-
src/bin/pg_ctl/t/001_start_stop.pl | 40 +-
src/bin/pg_ctl/t/002_status.pl | 15 +-
src/bin/pg_ctl/t/003_promote.pl | 17 +-
src/bin/pg_dump/t/002_pg_dump.pl | 453 ++++++++++++---------
src/bin/pg_dump/t/003_pg_dump_with_server.pl | 15 +-
src/bin/pg_dump/t/004_pg_dump_parallel.pl | 33 +-
src/bin/pg_dump/t/005_pg_dump_filterfile.pl | 290 +++++++++----
src/bin/pg_dump/t/010_dump_connstr.pl | 200 ++++++---
src/bin/pg_resetwal/t/001_basic.pl | 81 ++--
src/bin/pg_resetwal/t/002_corrupted.pl | 4 +-
src/bin/pg_rewind/t/001_basic.pl | 16 +-
src/bin/pg_rewind/t/006_options.pl | 25 +-
src/bin/pg_rewind/t/007_standby_source.pl | 10 +-
src/bin/pg_rewind/t/008_min_recovery_point.pl | 6 +-
src/bin/pg_rewind/t/009_growing_files.pl | 4 +-
src/bin/pg_rewind/t/010_keep_recycled_wals.pl | 4 +-
src/bin/pg_rewind/t/RewindTest.pm | 38 +-
src/bin/pg_test_fsync/t/001_basic.pl | 4 +-
src/bin/pg_test_timing/t/001_basic.pl | 4 +-
src/bin/pg_upgrade/t/004_subscription.pl | 45 +-
src/bin/pg_verifybackup/t/001_basic.pl | 6 +-
src/bin/pg_verifybackup/t/003_corruption.pl | 8 +-
src/bin/pg_verifybackup/t/004_options.pl | 98 +++--
src/bin/pg_verifybackup/t/006_encoding.pl | 10 +-
src/bin/pg_verifybackup/t/007_wal.pl | 26 +-
src/bin/pg_verifybackup/t/010_client_untar.pl | 6 +-
src/bin/pg_waldump/t/001_basic.pl | 60 +--
src/bin/pg_waldump/t/002_save_fullpage.pl | 7 +-
src/bin/pgbench/t/001_pgbench_with_server.pl | 2 +-
src/bin/psql/t/001_basic.pl | 71 ++--
src/bin/scripts/t/010_clusterdb.pl | 4 +-
src/bin/scripts/t/011_clusterdb_all.pl | 8 +-
src/bin/scripts/t/020_createdb.pl | 216 ++++++----
src/bin/scripts/t/040_createuser.pl | 36 +-
src/bin/scripts/t/080_pg_isready.pl | 5 +-
src/bin/scripts/t/090_reindexdb.pl | 107 +++--
src/bin/scripts/t/091_reindexdb_all.pl | 16 +-
src/bin/scripts/t/100_vacuumdb.pl | 95 +++--
src/bin/scripts/t/101_vacuumdb_all.pl | 6 +-
src/test/recovery/t/001_stream_rep.pl | 7 +-
src/test/recovery/t/003_recovery_targets.pl | 14 +-
src/test/recovery/t/017_shm.pl | 14 +-
src/test/recovery/t/024_archive_recovery.pl | 7 +-
src/test/recovery/t/027_stream_regress.pl | 34 +-
src/test/ssl/t/001_ssltests.pl | 32 +-
65 files changed, 2311 insertions(+), 1318 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-01-22 06:48:14 pgsql: Additional tests for stored generated columns
Previous Message Amit Kapila 2025-01-22 05:34:31 pgsql: Doc: Update the interaction of tablesync with wal_retrieve_retry