Skip to content

Commit 91d3580

Browse files
Use test functions in pg_rewind test module
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]
1 parent 2313a3e commit 91d3580

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/bin/pg_rewind/t/RewindTest.pm

+4-15
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,10 @@ sub check_query
102102
],
103103
'>', \$stdout, '2>', \$stderr;
104104

105-
# We don't use ok() for the exit code and stderr, because we want this
106-
# check to be just a single test.
107-
if (!$result)
108-
{
109-
fail("$test_name: psql exit code");
110-
}
111-
elsif ($stderr ne '')
112-
{
113-
diag $stderr;
114-
fail("$test_name: psql no stderr");
115-
}
116-
else
117-
{
118-
is($stdout, $expected_stdout, "$test_name: query result matches");
119-
}
105+
is($result, 1, "$test_name: psql exit code");
106+
is($stderr, '', "$test_name: psql no stderr");
107+
is($stdout, $expected_stdout, "$test_name: query result matches");
108+
120109
return;
121110
}
122111

0 commit comments

Comments
 (0)