[check_postgres] [commit] Remove all tables, so other test tables don't interfere.

check_postgres at bucardo.org check_postgres at bucardo.org
Thu Apr 23 17:52:48 UTC 2009


Committed by Greg Sabino Mullane <greg at endpoint.com>

Remove all tables, so other test tables don't interfere.

---
 t/02_relation_size.t |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/t/02_relation_size.t b/t/02_relation_size.t
index f1e28ce..acc3c10 100644
--- a/t/02_relation_size.t
+++ b/t/02_relation_size.t
@@ -52,9 +52,14 @@ like ($cp->run(q{-w 1 --perflimit 2}),
 $t = qq{$S detects no matching tables due to unknown user};
 like ($cp->run(q{-w 1 --includeuser foo}), qr{$label OK:.*No matching entries found due to user exclusion/inclusion options}, $t);
 
+## We need to remove all tables to make this work correctly
 local $dbh->{Warn} = 0;
-$dbh->do("DROP TABLE IF EXISTS $testtbl");
+my @info = $dbh->tables('','public','','TABLE');
+for my $tab (@info) {
+	$dbh->do("DROP TABLE $tab CASCADE");
+}
 $dbh->do(qq{CREATE TABLE $testtbl (a integer)});
+
 $dbh->commit;
 
 $t = qq{$S detects matching tables using 'testuser'};
-- 
1.6.0.5



More information about the Check_postgres mailing list