diff options
author | Michael Paquier | 2025-03-17 03:42:23 +0000 |
---|---|---|
committer | Michael Paquier | 2025-03-17 03:42:23 +0000 |
commit | 19c6e92b13b2336d1db1b236457ab15d0894b506 (patch) | |
tree | 672b72d1e75f47fbbe28db3326267804c6af6dcf /src/bin/psql | |
parent | 5721e5453ebc59360b6756fe72d7499c4a02177c (diff) |
Apply more consistent style for command options in TAP tests
This commit reshapes the grammar of some commands to apply a more
consistent style across the board, following rules similar to
ce1b0f9da03e:
- Elimination of some pointless used-once variables.
- Use of long options, to self-document better the options used.
- Use of fat commas to link option names and their assigned values,
including redirections, so as perltidy can be tricked to put them
together.
Author: Dagfinn Ilmari Mannsåker <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/bin/psql')
-rw-r--r-- | src/bin/psql/t/001_basic.pl | 5 | ||||
-rw-r--r-- | src/bin/psql/t/020_cancel.pl | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/bin/psql/t/001_basic.pl b/src/bin/psql/t/001_basic.pl index 3170bc86856..dca34ac975a 100644 --- a/src/bin/psql/t/001_basic.pl +++ b/src/bin/psql/t/001_basic.pl @@ -52,8 +52,9 @@ foreach my $arg (qw(commands variables)) my ($stdout, $stderr); my $result; - $result = IPC::Run::run [ 'psql', "--help=$arg" ], '>', \$stdout, '2>', - \$stderr; + $result = IPC::Run::run [ 'psql', "--help=$arg" ], + '>' => \$stdout, + '2>' => \$stderr; ok($result, "psql --help=$arg exit code 0"); isnt($stdout, '', "psql --help=$arg goes to stdout"); is($stderr, '', "psql --help=$arg nothing to stderr"); diff --git a/src/bin/psql/t/020_cancel.pl b/src/bin/psql/t/020_cancel.pl index a40f86293f2..154a24bca98 100644 --- a/src/bin/psql/t/020_cancel.pl +++ b/src/bin/psql/t/020_cancel.pl @@ -22,8 +22,13 @@ $node->start; local %ENV = $node->_get_env(); my ($stdin, $stdout, $stderr); -my $h = IPC::Run::start([ 'psql', '-X', '-v', 'ON_ERROR_STOP=1' ], - \$stdin, \$stdout, \$stderr); +my $h = IPC::Run::start( + [ + 'psql', '--no-psqlrc', '--set' => 'ON_ERROR_STOP=1', + ], + '<' => \$stdin, + '>' => \$stdout, + '2>' => \$stderr); # Send sleep command and wait until the server has registered it $stdin = "select pg_sleep($PostgreSQL::Test::Utils::timeout_default);\n"; |