aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/t/011_clusterdb_all.pl
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-01-22 14:47:13 +0900
committerMichael Paquier <michael@paquier.xyz>2025-01-22 14:47:13 +0900
commitce1b0f9da03e1cebc293f60b378079b22bd7cc0f (patch)
tree78c3030de2cc9d201168e8297b5754bf35e37fd2 /src/bin/scripts/t/011_clusterdb_all.pl
parent4a0e7314f11ee03adfe9df945598c068b4179314 (diff)
downloadpostgresql-ce1b0f9da03e1cebc293f60b378079b22bd7cc0f.tar.gz
postgresql-ce1b0f9da03e1cebc293f60b378079b22bd7cc0f.zip
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
Diffstat (limited to 'src/bin/scripts/t/011_clusterdb_all.pl')
-rw-r--r--src/bin/scripts/t/011_clusterdb_all.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl
index beaf2930f0e..cf06c8c1f8e 100644
--- a/src/bin/scripts/t/011_clusterdb_all.pl
+++ b/src/bin/scripts/t/011_clusterdb_all.pl
@@ -15,7 +15,7 @@ $node->start;
# clusterdb -a is not compatible with -d. This relies on PGDATABASE to be
# set, something PostgreSQL::Test::Cluster does.
$node->issues_sql_like(
- [ 'clusterdb', '-a' ],
+ [ 'clusterdb', '--all' ],
qr/statement: CLUSTER.*statement: CLUSTER/s,
'cluster all databases');
@@ -24,13 +24,13 @@ $node->safe_psql(
CREATE DATABASE regression_invalid;
UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid';
));
-$node->command_ok([ 'clusterdb', '-a' ],
+$node->command_ok([ 'clusterdb', '--all' ],
'invalid database not targeted by clusterdb -a');
# Doesn't quite belong here, but don't want to waste time by creating an
# invalid database in 010_clusterdb.pl as well.
$node->command_fails_like(
- [ 'clusterdb', '-d', 'regression_invalid' ],
+ [ 'clusterdb', '--dbname' => 'regression_invalid' ],
qr/FATAL: cannot connect to invalid database "regression_invalid"/,
'clusterdb cannot target invalid database');
@@ -41,7 +41,7 @@ $node->safe_psql('template1',
'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'
);
$node->issues_sql_like(
- [ 'clusterdb', '-a', '-t', 'test1' ],
+ [ 'clusterdb', '--all', '--table' => 'test1' ],
qr/statement: CLUSTER public\.test1/s,
'cluster specific table in all databases');