Skip to content

Commit

Permalink
Use test functions in pg_rewind test module
Browse files Browse the repository at this point in the history
Commit 61081e7 introduced pg_rewind along with the test suite, which
ensured that subroutines didn't incur more than one test to plan.  Now
that we no longer explicitly plan tests (since 549ec20),  we can use
the usual Test::More functions.

Reviewed-by: Andrew Dunstan <[email protected]>
Discussion: https://postgr.es/m/[email protected]
  • Loading branch information
danielgustafsson committed Feb 23, 2022
1 parent 2313a3e commit 91d3580
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/bin/pg_rewind/t/RewindTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,10 @@ sub check_query
],
'>', \$stdout, '2>', \$stderr;

# We don't use ok() for the exit code and stderr, because we want this
# check to be just a single test.
if (!$result)
{
fail("$test_name: psql exit code");
}
elsif ($stderr ne '')
{
diag $stderr;
fail("$test_name: psql no stderr");
}
else
{
is($stdout, $expected_stdout, "$test_name: query result matches");
}
is($result, 1, "$test_name: psql exit code");
is($stderr, '', "$test_name: psql no stderr");
is($stdout, $expected_stdout, "$test_name: query result matches");

return;
}

Expand Down

0 comments on commit 91d3580

Please sign in to comment.