Author: turnstep
Date: Mon May 5 05:16:23 2008
New Revision: 11199
Modified:
DBD-Pg/trunk/t/02attribs.t
DBD-Pg/trunk/t/99_spellcheck.t
DBD-Pg/trunk/t/dbdpg_test_setup.pl
Log:
Minor tweaks.
Modified: DBD-Pg/trunk/t/02attribs.t
==============================================================================
--- DBD-Pg/trunk/t/02attribs.t (original)
+++ DBD-Pg/trunk/t/02attribs.t Mon May 5 05:16:23 2008
@@ -324,7 +324,7 @@
my $oldscs = $dbh->{pg_standard_conforming_strings};
like( $oldscs, qr/^on|off$/, $t);
-$dbh->do("SET standard_conforming_strings = on");
+$dbh->do('SET standard_conforming_strings = on');
$t=q{DB handle attribute "pg_standard_conforming_strings" returns correct
value};
$result = $dbh->{pg_standard_conforming_strings};
is( $result, 'on', $t);
@@ -332,7 +332,7 @@
$result = $dbh->{pg_scs};
is( $result, 'on', $t);
-$dbh->do("SET standard_conforming_strings = off");
+$dbh->do('SET standard_conforming_strings = off');
$t=q{DB handle attribute "pg_standard_conforming_strings" returns correct
value};
$result = $dbh->{pg_standard_conforming_strings};
is( $result, 'off', $t);
@@ -357,11 +357,11 @@
local $dbh->{pg_enable_utf8} = 1;
my $utf8_str = chr(0x100).'dam'; # LATIN CAPITAL LETTER A WITH MACRON
- $dbh->do("SET standard_conforming_strings = off");
+ $dbh->do('SET standard_conforming_strings = off');
$t=q{Database method quote() handles utf8};
is( $dbh->quote( $utf8_str ), "'$utf8_str'", $t);
- $dbh->do("SET standard_conforming_strings = on");
+ $dbh->do('SET standard_conforming_strings = on');
$t=q{Database method quote() handles utf8};
is( $dbh->quote( $utf8_str ), "E'$utf8_str'", $t);
Modified: DBD-Pg/trunk/t/99_spellcheck.t
==============================================================================
--- DBD-Pg/trunk/t/99_spellcheck.t (original)
+++ DBD-Pg/trunk/t/99_spellcheck.t Mon May 5 05:16:23 2008
@@ -19,7 +19,7 @@
else {
opendir my $dir, 't' or die qq{Could not open directory 't': $!\n};
@testfiles = map { "t/$_" } grep { /^.+\.(t|pl)$/ } readdir $dir;
- closedir $dir;
+ closedir $dir or die qq{Could not closedir "$dir": $!\n};
plan tests => [EMAIL PROTECTED];
}
@@ -54,6 +54,7 @@
for (sort keys %badword) {
diag "$_\n";
}
+ return;
}
@@ -64,7 +65,7 @@
}
else {
{ local $/; $_ = <$fh>; }
- close $fh;
+ close $fh or warn qq{Could not close "$file": $!\n};
if ($file eq 'Changes') {
s{\b(?:from|by) [A-Z][\w \.]+[<\[\n]}{}gs;
s{\b[Tt]hanks to ([A-Z]\w+\W){1,3}}{}gs;
@@ -77,7 +78,6 @@
s/^\t\$.+//gsm;
}
spellcheck($file => $_, $file);
- close $fh;
}
}
@@ -103,7 +103,7 @@
}
{
## For XS files...
- package File::Comments::Plugin::Catchall;
+ package File::Comments::Plugin::Catchall; ## no critic
use strict;
use warnings;
use File::Comments::Plugin;
@@ -127,7 +127,7 @@
for my $file (@testfiles, qw{Makefile.PL Pg.xs Pg.pm
lib/Bundle/DBD/Pg.pm
- dbdimp.c dbdimp.h types.c quote.c
quote.h Pg.h types.h}) {
+ dbdimp.c dbdimp.h types.c quote.c quote.h Pg.h types.h}) {
## Tests as well?
if (! -e $file) {
fail(qq{Could not find the file "$file"!});
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 Mon May 5 05:16:23 2008
@@ -195,7 +195,7 @@
last GETHANDLE if $@;
if (!defined $info or $info !~ /[EMAIL PROTECTED]/) {
- $@ = defined $info ? "Bad initdb output: $info" : "Bad
initdb output";
+ $@ = defined $info ? "Bad initdb output: $info" : 'Bad
initdb output';
last GETHANDLE;
}
@@ -321,7 +321,7 @@
## Attempt to connect to this server
sleep 1;
$testdsn = "dbi:Pg:dbname=postgres;port=$testport";
- $^O =~ /Win32/ and $testdsn .= ";host=localhost";
+ $^O =~ /Win32/ and $testdsn .= ';host=localhost';
my $loop = 1;
STARTUP: {
eval {