1
0
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:
Peter Eisentraut
2016-07-26 10:48:43 -04:00
parent e767db2242
commit eb5089a05b
2 changed files with 50 additions and 0 deletions

View File

@ -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;