mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
pg_ctl: Add tests for promote action
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@ -34,6 +34,7 @@ our @EXPORT = qw(
|
||||
program_version_ok
|
||||
program_options_handling_ok
|
||||
command_like
|
||||
command_fails_like
|
||||
|
||||
$windows_os
|
||||
);
|
||||
@ -281,4 +282,14 @@ sub command_like
|
||||
like($stdout, $expected_stdout, "$test_name: matches");
|
||||
}
|
||||
|
||||
sub command_fails_like
|
||||
{
|
||||
my ($cmd, $expected_stderr, $test_name) = @_;
|
||||
my ($stdout, $stderr);
|
||||
print("# Running: " . join(" ", @{$cmd}) . "\n");
|
||||
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
|
||||
ok(!$result, "$test_name: exit code not 0");
|
||||
like($stderr, $expected_stderr, "$test_name: matches");
|
||||
}
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user