On Thu, Mar 23, 2017 at 12:51 AM, Erik Rijkers <e...@xs4all.nl> wrote: > While trying to test pgbench's stderr (looking for 'creating tables' in > output of the initialisation step) I ran into these two bugs (or perhaps > better 'oversights').
+ if (defined $expected_stderr) { + like($stderr, $expected_stderr, "$test_name: stderr matches"); + } + else { is($stderr, '', "$test_name: no stderr"); - like($stdout, $expected_stdout, "$test_name: matches"); + } To simplify that you could as well set expected_output to be an empty string, and just use like() instead of is(), saving this if/else. > But especially the omission of command_fails_like() in PostgresNode.pm feels > like an bug. +=item $node->command_fails_like(...) - TestLib::command_fails_like with our PGPORT + +See command_ok(...) + +=cut + +sub command_fails_like +{ + my $self = shift; + + local $ENV{PGPORT} = $self->port; + + TestLib::command_fails_like(@_); +} Most likely a case where this is needed has not showed up, so +1 to remove this inconsistency across the modules. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers