From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Erik Rijkers <er(at)xs4all(dot)nl> |
Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, peter(dot)eisentraut(at)2ndquadrant(dot)com |
Subject: | Re: bug/oversight in TestLib.pm and PostgresNode.pm |
Date: | 2017-03-23 02:28:30 |
Message-ID: | CAB7nPqRgFAOh3_0kZXKUCdbQzzSxnG4GvUOg4dM49cngtLHv-Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Mar 23, 2017 at 12:51 AM, Erik Rijkers <er(at)xs4all(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2017-03-23 02:34:54 | Re: pageinspect and hash indexes |
Previous Message | Thomas Munro | 2017-03-23 02:02:48 | Re: Measuring replay lag |