From d100ee7ad2cb9fb276dbbb9886ebfc5f40e3924c Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 20 Jan 2011 23:35:42 -0500 Subject: Testing fixes. --- perlcriticrc | 2 +- t/02_txn_time.t | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/perlcriticrc b/perlcriticrc index c162ef943..a83b8443c 100644 --- a/perlcriticrc +++ b/perlcriticrc @@ -61,7 +61,7 @@ stop_words = Mullane Nagios Slony Slony's nols salesrep psql dbname postgres USE [-References::ProhibitDoubleSigils] -#[-RegularExpressions::ProhibitCaptureWithoutTest] +[-RegularExpressions::ProhibitCaptureWithoutTest] [-RegularExpressions::ProhibitComplexRegexes] [-RegularExpressions::ProhibitEnumeratedClasses] [-RegularExpressions::ProhibitEscapedMetacharacters] diff --git a/t/02_txn_time.t b/t/02_txn_time.t index e7cc8b033..22b0d33b4 100644 --- a/t/02_txn_time.t +++ b/t/02_txn_time.t @@ -53,8 +53,8 @@ for ('-1 second', like ($cp->run(qq{-w "$_"}), qr/^ERROR:.*?must be a valid time/, $t . " ($_)"); } -$t = qq{$S flags no-match-user}; -like ($cp->run(q{-w 0 --includeuser=gandalf}), qr{No matching.*user}, $t); +$t = qq{$S flags no transactions}; +like ($cp->run(q{-w 0 --includeuser=gandalf}), qr{No transactions}, $t); if ($cp->run(q{-w 0 --output=simple}) > 0) { BAIL_OUT(qq{Cannot continue with "$S" test: txn_time count > 0\nIs someone else connected to your test database?}); @@ -64,19 +64,19 @@ $t = qq{$S finds no txn}; like ($cp->run(q{-w 0 --include=nosuchtablename}), qr/$label OK:.*No transactions/, $t); $t = qq{$S identifies no running txn}; -like ($result, qr{longest txn: 0s}, $t); +like ($result, qr{longest query: 0s}, $t); $t .= ' (MRTG)'; -is ($cp->run(q{--output=mrtg -w 0}), qq{0\n0\n\nDB: $dbname\n}, $t); +like ($cp->run(q{--output=mrtg -w 0}), qr{0\n0\n\ndatabase:$dbname PID:\d+ username:\w+\n}, $t); $t = qq{$S identifies a one-second running txn}; my $idle_dbh = $cp->test_database_handle(); $idle_dbh->do('SELECT 1'); sleep(1); -like ($cp->run(q{-w 0}), qr{longest txn: 1s}, $t); +like ($cp->run(q{-w 0}), qr{longest query: 1s}, $t); $t .= ' (MRTG)'; -like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nDB: $dbname\n}, $t); +like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\ndatabase:$dbname PID:\d+ username:\w+\n}, $t); $idle_dbh->commit; -- cgit v1.2.3