Author: turnstep
Date: Wed Apr 30 16:07:53 2008
New Revision: 11158

Modified:
   DBD-Pg/trunk/.perlcriticrc
   DBD-Pg/trunk/t/07copy.t
   DBD-Pg/trunk/t/99_perlcritic.t
   DBD-Pg/trunk/t/dbdpg_test_setup.pl

Log:
Minor Perl::Critic related changes.


Modified: DBD-Pg/trunk/.perlcriticrc
==============================================================================
--- DBD-Pg/trunk/.perlcriticrc  (original)
+++ DBD-Pg/trunk/.perlcriticrc  Wed Apr 30 16:07:53 2008
@@ -23,8 +23,10 @@
 [-Documentation::RequirePODUseEncodingUTF8]
 [-Editor::RequireEmacsFileVariables]
 [-ErrorHandling::RequireCarping]
+[-InputOutput::ProhibitBacktickOperators]
 [-InputOutput::ProhibitOneArgSelect]
 [-InputOutput::RequireCheckedSyscalls]
+[-InputOutput::RequireBriefOpen]
 [-Lax::ProhibitComplexMappings::LinesNotStatements]
 [-Lax::ProhibitEmptyQuotes::ExceptAsFallback]
 [-Lax::ProhibitStringyEval::ExceptForRequire]
@@ -72,4 +74,3 @@
 [-Modules::RequirePerlVersion]
 [-Modules::RequireVersionVar]
 [-ValuesAndExpressions::ProhibitEscapedCharacters]
-

Modified: DBD-Pg/trunk/t/07copy.t
==============================================================================
--- DBD-Pg/trunk/t/07copy.t     (original)
+++ DBD-Pg/trunk/t/07copy.t     Wed Apr 30 16:07:53 2008
@@ -303,7 +303,7 @@
 is($@, q{}, $t);
 
 $t=q{pg_getcopydata works when pulling from an empty table into an empty var};
-$dbh->do("COPY (SELECT 1 FROM pg_class LIMIT 0) TO STDOUT");
+$dbh->do(q{COPY (SELECT 1 FROM pg_class LIMIT 0) TO STDOUT});
 eval {
        my $newvar;
        $dbh->pg_getcopydata($newvar);

Modified: DBD-Pg/trunk/t/99_perlcritic.t
==============================================================================
--- DBD-Pg/trunk/t/99_perlcritic.t      (original)
+++ DBD-Pg/trunk/t/99_perlcritic.t      Wed Apr 30 16:07:53 2008
@@ -27,7 +27,7 @@
        closedir $dir;
        plan tests => [EMAIL PROTECTED];
 }
-ok(@testfiles, 'Found files in test directory');
+ok(@testfiles, ' Found files in test directory');
 
 ## Check some non-test files
 my $critic = Perl::Critic->new(-severity => 1);
@@ -152,7 +152,7 @@
                diag "Policy: $policy\n";
                diag "Source: $source\n\n";
        }
-       my $SPACE = ++$count < 9 ? ' ' : '';
+       my $SPACE = ++$count < 7 ? ' ' : '';
        if ($vios) {
                fail qq{${SPACE}Failed Perl::Critic tests for file "$filename": 
$vios};
        }

Modified: DBD-Pg/trunk/t/dbdpg_test_setup.pl
==============================================================================
--- DBD-Pg/trunk/t/dbdpg_test_setup.pl  (original)
+++ DBD-Pg/trunk/t/dbdpg_test_setup.pl  Wed Apr 30 16:07:53 2008
@@ -228,7 +228,7 @@
                                print $fh "This is a test directory for DBD::Pg 
and may be removed\n";
                                print $fh "You may want to ensure the 
postmaster has been stopped first.\n";
                                print $fh "Check the port in the 
postgresql.conf file\n";
-                               close $fh;
+                               close $fh or die qq{Could not close "$readme": 
$!\n};
                        }
                        my $founduser = 0;
                        $su = $testuser = '';
@@ -297,7 +297,7 @@
                        last GETHANDLE;
                }
                print $cfh "\n\n## DBD::Pg testing port\nport=$testport\n\n";
-               close $cfh;
+               close $cfh or die qq{Could not close "$conf": $!\n};
 
                ## Attempt to start up the test server
                $info = '';
@@ -338,7 +338,7 @@
 
        if (open my $fh, '>', $helpfile) {
                print $fh "## This is a temporary file created for testing 
DBD::Pg\n";
-               print $fh "## Created: " . scalar localtime() . "\n";
+               print $fh '## Created: ' . scalar localtime() . "\n";
                print $fh "## Feel free to remove it!\n";
                print $fh "## Helpconnect: $helpconnect\n";
                if ($@) {
@@ -351,7 +351,7 @@
                        print $fh "## Testdir: $test_database_dir\n" if 16 == 
$helpconnect;
                        print $fh "## Testowner: $su\n" if $su;
                }
-               close $fh;
+               close $fh or dir qq{Could not close "$helpfile": $!\n};
        }
 
   GOTDBH:

Reply via email to