[check_postgres] [commit] Minor testing changes.

check_postgres at bucardo.org check_postgres at bucardo.org
Fri Apr 24 23:27:19 UTC 2009


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

Minor testing changes.

---
 t/00_test_tester.t   |    4 ++--
 t/02_database_size.t |    8 ++------
 t/02_version.t       |    3 +++
 t/99_spellcheck.t    |    1 +
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/00_test_tester.t b/t/00_test_tester.t
index 9ae0c5e..97fdc00 100644
--- a/t/00_test_tester.t
+++ b/t/00_test_tester.t
@@ -38,10 +38,10 @@ for my $act (sort keys %action) {
 }
 
 if ($ok) {
-	pass "There is a test for every action\n";
+	pass 'There is a test for every action';
 }
 else {
-	fail "Did not find a test for every action\n";
+	fail 'Did not find a test for every action';
 }
 
 exit;
diff --git a/t/02_database_size.t b/t/02_database_size.t
index ee35844..f13b16e 100644
--- a/t/02_database_size.t
+++ b/t/02_database_size.t
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 use Data::Dumper;
-use Test::More tests => 50;
+use Test::More tests => 49;
 use lib 't','.';
 use CP_Testing;
 
@@ -55,10 +55,6 @@ $t=qq{$S fails when the warning or critical size is negative};
 like ($cp->run('-w -10'), qr{^ERROR: Invalid size}, $t);
 like ($cp->run('-c -20'), qr{^ERROR: Invalid size}, $t);
 
-## Not sure how to do this check in Windows
-$t=qq{$S with excludeuser option returns the expected result (uses user: $ENV{USER})};
-like ($cp->run("-w 10g --excludeuser $ENV{USER}"), qr{No matching entries found due to user exclusion}, $t);
-
 $t=qq{$S with includeuser option returns the expected result};
 $user = $cp->get_user();
 $dbh->{AutoCommit} = 1;
@@ -77,7 +73,7 @@ like ($cp->run('-w 1 -c 1'), qr{^POSTGRES_DATABASE_SIZE CRITICAL}, $t);
 like ($cp->run('--critical=1 --warning=0'), qr{^POSTGRES_DATABASE_SIZE CRITICAL}, $t);
 
 $t=qq{$S returns correct MRTG output when no rows found};
-like ($cp->run("--output=MRTG -w 10g --excludeuser $ENV{USER}"), qr{^-1}, $t);
+like ($cp->run("--output=MRTG -w 10g --includeuser nosuchuser"), qr{^-1}, $t);
 
 $t=qq{$S returns correct MRTG output when rows found};
 like ($cp->run('--output=MRTG -w 10g'), qr{\d+\n0\n\nDB: postgres\n}s, $t);
diff --git a/t/02_version.t b/t/02_version.t
index f2d46a7..143cf90 100644
--- a/t/02_version.t
+++ b/t/02_version.t
@@ -106,6 +106,9 @@ is ($cp->run('--output=MRTG --mrtg=7.8'), qq{1\n0\n\n7.8.12\n}, $t);
 $t=qq{$S gives correct output for MRTG output};
 is ($cp->run('--output=MRTG --mrtg=7.8.12'), qq{1\n0\n\n7.8.12\n}, $t);
 
+local $dbh->{Warn} = 0;
+$dbh->do('DROP SCHEMA cptest CASCADE');
+$dbh->do('DROP FUNCTION public.version()');
 $cp->reset_path();
 
 exit;
diff --git a/t/99_spellcheck.t b/t/99_spellcheck.t
index b3fb60b..a66a5e0 100644
--- a/t/99_spellcheck.t
+++ b/t/99_spellcheck.t
@@ -133,6 +133,7 @@ __DATA__
 ## Common:
 
 arrayref
+autovac
 Backends
 backends
 bucardo
-- 
1.6.0.5



More information about the Check_postgres mailing list