Skip to content
Snippets Groups Projects
Commit 2ff0b275 authored by Martin Pitt's avatar Martin Pitt
Browse files

improve error message in pg_wrapper, adapt test suite

parent 771bed79
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ my ($version, $cluster, $db, $port); ...@@ -16,7 +16,7 @@ my ($version, $cluster, $db, $port);
if (defined $ENV{PGCLUSTER}) { if (defined $ENV{PGCLUSTER}) {
($version, $cluster) = split ('/', $ENV{PGCLUSTER}, 2); ($version, $cluster) = split ('/', $ENV{PGCLUSTER}, 2);
error 'Invalid version specified with $PGCLUSTER' unless version_exists $version; error 'Invalid version specified with $PGCLUSTER' unless version_exists $version;
error 'Invalid cluster specified with $PGCLUSTER' unless $cluster; error 'No cluster specified with $PGCLUSTER' unless $cluster;
error 'Cluster specified with $PGCLUSTER does not exist' unless cluster_exists $version, $cluster; error 'Cluster specified with $PGCLUSTER does not exist' unless cluster_exists $version, $cluster;
} }
...@@ -28,7 +28,6 @@ for (my $i = 0; $i <= $#ARGV; ++$i) { ...@@ -28,7 +28,6 @@ for (my $i = 0; $i <= $#ARGV; ++$i) {
($version, $cluster) = split ('/', $ARGV[$i+1], 2); ($version, $cluster) = split ('/', $ARGV[$i+1], 2);
error 'Invalid version specified with --cluster' unless version_exists $version; error 'Invalid version specified with --cluster' unless version_exists $version;
error 'No cluster specified with --cluster' unless $cluster; error 'No cluster specified with --cluster' unless $cluster;
error 'Cluster does not exist' unless cluster_exists $version, $cluster; error 'Cluster does not exist' unless cluster_exists $version, $cluster;
splice @ARGV, $i, 2; splice @ARGV, $i, 2;
......
...@@ -48,7 +48,7 @@ unlike_program_out 'postgres', "psql -Atl", 0, qr/test\|postgres\|/, ...@@ -48,7 +48,7 @@ unlike_program_out 'postgres', "psql -Atl", 0, qr/test\|postgres\|/,
'PGCLUSTER selection (2)'; 'PGCLUSTER selection (2)';
$ENV{'PGCLUSTER'} = 'foo'; $ENV{'PGCLUSTER'} = 'foo';
like_program_out 'postgres', "psql -l", 1, like_program_out 'postgres', "psql -l", 1,
qr/Invalid cluster specified with \$PGCLUSTER/, qr/Invalid version specified with \$PGCLUSTER/,
'invalid PGCLUSTER value'; 'invalid PGCLUSTER value';
delete $ENV{'PGCLUSTER'}; delete $ENV{'PGCLUSTER'};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment