Author: turnstep
Date: Sun Jul 6 18:37:54 2008
New Revision: 11491
Modified:
DBD-Pg/trunk/t/01connect.t
DBD-Pg/trunk/t/01constants.t
DBD-Pg/trunk/t/02attribs.t
DBD-Pg/trunk/t/03dbmethod.t
DBD-Pg/trunk/t/04misc.t
DBD-Pg/trunk/t/06bytea.t
DBD-Pg/trunk/t/07copy.t
DBD-Pg/trunk/t/08async.t
DBD-Pg/trunk/t/09arrays.t
DBD-Pg/trunk/t/12placeholders.t
DBD-Pg/trunk/t/20savepoints.t
DBD-Pg/trunk/t/99_pod.t
DBD-Pg/trunk/t/99_spellcheck.t
DBD-Pg/trunk/t/99_yaml.t
DBD-Pg/trunk/t/99cleanup.t
Log:
Even more test cleanups.
Modified: DBD-Pg/trunk/t/01connect.t
==============================================================================
--- DBD-Pg/trunk/t/01connect.t (original)
+++ DBD-Pg/trunk/t/01connect.t Sun Jul 6 18:37:54 2008
@@ -25,19 +25,19 @@
}
plan tests => 13;
-pass('Established a connection to the database');
+pass ('Established a connection to the database');
$pgversion = $dbh->{pg_server_version};
$pglibversion = $dbh->{pg_lib_version};
$pgdefport = $dbh->{pg_default_port};
$pgvstring = $dbh->selectall_arrayref('SELECT VERSION()')->[0][0];
-ok( $dbh->disconnect(), 'Disconnect from the database');
+ok ($dbh->disconnect(), 'Disconnect from the database');
# Connect two times. From this point onward, do a simpler connection check
$dbh = connect_database();
-pass('Connected with first database handle');
+pass ('Connected with first database handle');
## Grab some important values used for debugging
my @vals = qw/array_nulls backslash_quote server_encoding client_encoding standard_conforming_strings/;
@@ -49,7 +49,7 @@
my $dbh2 = connect_database();
-pass('Connected with second database handle');
+pass ('Connected with second database handle');
my $sth = $dbh->prepare('SELECT 123');
ok ($dbh->disconnect(), 'Disconnect with first database handle');
Modified: DBD-Pg/trunk/t/01constants.t
==============================================================================
--- DBD-Pg/trunk/t/01constants.t (original)
+++ DBD-Pg/trunk/t/01constants.t Sun Jul 6 18:37:54 2008
@@ -11,137 +11,137 @@
## Should match the list in Pg.xs
## This is auto-generated by types.c, so do not edit manually please
-is(PG_ABSTIME , 702, 'PG_ABSTIME returns correct value');
-is(PG_ABSTIMEARRAY , 1023, 'PG_ABSTIMEARRAY returns correct value');
-is(PG_ACLITEM , 1033, 'PG_ACLITEM returns correct value');
-is(PG_ACLITEMARRAY , 1034, 'PG_ACLITEMARRAY returns correct value');
-is(PG_ANY , 2276, 'PG_ANY returns correct value');
-is(PG_ANYARRAY , 2277, 'PG_ANYARRAY returns correct value');
-is(PG_ANYELEMENT , 2283, 'PG_ANYELEMENT returns correct value');
-is(PG_ANYENUM , 3500, 'PG_ANYENUM returns correct value');
-is(PG_ANYNONARRAY , 2776, 'PG_ANYNONARRAY returns correct value');
-is(PG_BIT , 1560, 'PG_BIT returns correct value');
-is(PG_BITARRAY , 1561, 'PG_BITARRAY returns correct value');
-is(PG_BOOL , 16, 'PG_BOOL returns correct value');
-is(PG_BOOLARRAY , 1000, 'PG_BOOLARRAY returns correct value');
-is(PG_BOX , 603, 'PG_BOX returns correct value');
-is(PG_BOXARRAY , 1020, 'PG_BOXARRAY returns correct value');
-is(PG_BPCHAR , 1042, 'PG_BPCHAR returns correct value');
-is(PG_BPCHARARRAY , 1014, 'PG_BPCHARARRAY returns correct value');
-is(PG_BYTEA , 17, 'PG_BYTEA returns correct value');
-is(PG_BYTEAARRAY , 1001, 'PG_BYTEAARRAY returns correct value');
-is(PG_CHAR , 18, 'PG_CHAR returns correct value');
-is(PG_CHARARRAY , 1002, 'PG_CHARARRAY returns correct value');
-is(PG_CID , 29, 'PG_CID returns correct value');
-is(PG_CIDARRAY , 1012, 'PG_CIDARRAY returns correct value');
-is(PG_CIDR , 650, 'PG_CIDR returns correct value');
-is(PG_CIDRARRAY , 651, 'PG_CIDRARRAY returns correct value');
-is(PG_CIRCLE , 718, 'PG_CIRCLE returns correct value');
-is(PG_CIRCLEARRAY , 719, 'PG_CIRCLEARRAY returns correct value');
-is(PG_CSTRING , 2275, 'PG_CSTRING returns correct value');
-is(PG_CSTRINGARRAY , 1263, 'PG_CSTRINGARRAY returns correct value');
-is(PG_DATE , 1082, 'PG_DATE returns correct value');
-is(PG_DATEARRAY , 1182, 'PG_DATEARRAY returns correct value');
-is(PG_FLOAT4 , 700, 'PG_FLOAT4 returns correct value');
-is(PG_FLOAT4ARRAY , 1021, 'PG_FLOAT4ARRAY returns correct value');
-is(PG_FLOAT8 , 701, 'PG_FLOAT8 returns correct value');
-is(PG_FLOAT8ARRAY , 1022, 'PG_FLOAT8ARRAY returns correct value');
-is(PG_GTSVECTOR , 3642, 'PG_GTSVECTOR returns correct value');
-is(PG_GTSVECTORARRAY , 3644, 'PG_GTSVECTORARRAY returns correct value');
-is(PG_INET , 869, 'PG_INET returns correct value');
-is(PG_INETARRAY , 1041, 'PG_INETARRAY returns correct value');
-is(PG_INT2 , 21, 'PG_INT2 returns correct value');
-is(PG_INT2ARRAY , 1005, 'PG_INT2ARRAY returns correct value');
-is(PG_INT2VECTOR , 22, 'PG_INT2VECTOR returns correct value');
-is(PG_INT2VECTORARRAY , 1006, 'PG_INT2VECTORARRAY returns correct value');
-is(PG_INT4 , 23, 'PG_INT4 returns correct value');
-is(PG_INT4ARRAY , 1007, 'PG_INT4ARRAY returns correct value');
-is(PG_INT8 , 20, 'PG_INT8 returns correct value');
-is(PG_INT8ARRAY , 1016, 'PG_INT8ARRAY returns correct value');
-is(PG_INTERNAL , 2281, 'PG_INTERNAL returns correct value');
-is(PG_INTERVAL , 1186, 'PG_INTERVAL returns correct value');
-is(PG_INTERVALARRAY , 1187, 'PG_INTERVALARRAY returns correct value');
-is(PG_LANGUAGE_HANDLER , 2280, 'PG_LANGUAGE_HANDLER returns correct value');
-is(PG_LINE , 628, 'PG_LINE returns correct value');
-is(PG_LINEARRAY , 629, 'PG_LINEARRAY returns correct value');
-is(PG_LSEG , 601, 'PG_LSEG returns correct value');
-is(PG_LSEGARRAY , 1018, 'PG_LSEGARRAY returns correct value');
-is(PG_MACADDR , 829, 'PG_MACADDR returns correct value');
-is(PG_MACADDRARRAY , 1040, 'PG_MACADDRARRAY returns correct value');
-is(PG_MONEY , 790, 'PG_MONEY returns correct value');
-is(PG_MONEYARRAY , 791, 'PG_MONEYARRAY returns correct value');
-is(PG_NAME , 19, 'PG_NAME returns correct value');
-is(PG_NAMEARRAY , 1003, 'PG_NAMEARRAY returns correct value');
-is(PG_NUMERIC , 1700, 'PG_NUMERIC returns correct value');
-is(PG_NUMERICARRAY , 1231, 'PG_NUMERICARRAY returns correct value');
-is(PG_OID , 26, 'PG_OID returns correct value');
-is(PG_OIDARRAY , 1028, 'PG_OIDARRAY returns correct value');
-is(PG_OIDVECTOR , 30, 'PG_OIDVECTOR returns correct value');
-is(PG_OIDVECTORARRAY , 1013, 'PG_OIDVECTORARRAY returns correct value');
-is(PG_OPAQUE , 2282, 'PG_OPAQUE returns correct value');
-is(PG_PATH , 602, 'PG_PATH returns correct value');
-is(PG_PATHARRAY , 1019, 'PG_PATHARRAY returns correct value');
-is(PG_PG_ATTRIBUTE , 75, 'PG_PG_ATTRIBUTE returns correct value');
-is(PG_PG_CLASS , 83, 'PG_PG_CLASS returns correct value');
-is(PG_PG_PROC , 81, 'PG_PG_PROC returns correct value');
-is(PG_PG_TYPE , 71, 'PG_PG_TYPE returns correct value');
-is(PG_POINT , 600, 'PG_POINT returns correct value');
-is(PG_POINTARRAY , 1017, 'PG_POINTARRAY returns correct value');
-is(PG_POLYGON , 604, 'PG_POLYGON returns correct value');
-is(PG_POLYGONARRAY , 1027, 'PG_POLYGONARRAY returns correct value');
-is(PG_RECORD , 2249, 'PG_RECORD returns correct value');
-is(PG_REFCURSOR , 1790, 'PG_REFCURSOR returns correct value');
-is(PG_REFCURSORARRAY , 2201, 'PG_REFCURSORARRAY returns correct value');
-is(PG_REGCLASS , 2205, 'PG_REGCLASS returns correct value');
-is(PG_REGCLASSARRAY , 2210, 'PG_REGCLASSARRAY returns correct value');
-is(PG_REGCONFIG , 3734, 'PG_REGCONFIG returns correct value');
-is(PG_REGCONFIGARRAY , 3735, 'PG_REGCONFIGARRAY returns correct value');
-is(PG_REGDICTIONARY , 3769, 'PG_REGDICTIONARY returns correct value');
-is(PG_REGDICTIONARYARRAY , 3770, 'PG_REGDICTIONARYARRAY returns correct value');
-is(PG_REGOPER , 2203, 'PG_REGOPER returns correct value');
-is(PG_REGOPERARRAY , 2208, 'PG_REGOPERARRAY returns correct value');
-is(PG_REGOPERATOR , 2204, 'PG_REGOPERATOR returns correct value');
-is(PG_REGOPERATORARRAY , 2209, 'PG_REGOPERATORARRAY returns correct value');
-is(PG_REGPROC , 24, 'PG_REGPROC returns correct value');
-is(PG_REGPROCARRAY , 1008, 'PG_REGPROCARRAY returns correct value');
-is(PG_REGPROCEDURE , 2202, 'PG_REGPROCEDURE returns correct value');
-is(PG_REGPROCEDUREARRAY , 2207, 'PG_REGPROCEDUREARRAY returns correct value');
-is(PG_REGTYPE , 2206, 'PG_REGTYPE returns correct value');
-is(PG_REGTYPEARRAY , 2211, 'PG_REGTYPEARRAY returns correct value');
-is(PG_RELTIME , 703, 'PG_RELTIME returns correct value');
-is(PG_RELTIMEARRAY , 1024, 'PG_RELTIMEARRAY returns correct value');
-is(PG_SMGR , 210, 'PG_SMGR returns correct value');
-is(PG_TEXT , 25, 'PG_TEXT returns correct value');
-is(PG_TEXTARRAY , 1009, 'PG_TEXTARRAY returns correct value');
-is(PG_TID , 27, 'PG_TID returns correct value');
-is(PG_TIDARRAY , 1010, 'PG_TIDARRAY returns correct value');
-is(PG_TIME , 1083, 'PG_TIME returns correct value');
-is(PG_TIMEARRAY , 1183, 'PG_TIMEARRAY returns correct value');
-is(PG_TIMESTAMP , 1114, 'PG_TIMESTAMP returns correct value');
-is(PG_TIMESTAMPARRAY , 1115, 'PG_TIMESTAMPARRAY returns correct value');
-is(PG_TIMESTAMPTZ , 1184, 'PG_TIMESTAMPTZ returns correct value');
-is(PG_TIMESTAMPTZARRAY , 1185, 'PG_TIMESTAMPTZARRAY returns correct value');
-is(PG_TIMETZ , 1266, 'PG_TIMETZ returns correct value');
-is(PG_TIMETZARRAY , 1270, 'PG_TIMETZARRAY returns correct value');
-is(PG_TINTERVAL , 704, 'PG_TINTERVAL returns correct value');
-is(PG_TINTERVALARRAY , 1025, 'PG_TINTERVALARRAY returns correct value');
-is(PG_TRIGGER , 2279, 'PG_TRIGGER returns correct value');
-is(PG_TSQUERY , 3615, 'PG_TSQUERY returns correct value');
-is(PG_TSQUERYARRAY , 3645, 'PG_TSQUERYARRAY returns correct value');
-is(PG_TSVECTOR , 3614, 'PG_TSVECTOR returns correct value');
-is(PG_TSVECTORARRAY , 3643, 'PG_TSVECTORARRAY returns correct value');
-is(PG_TXID_SNAPSHOT , 2970, 'PG_TXID_SNAPSHOT returns correct value');
-is(PG_TXID_SNAPSHOTARRAY , 2949, 'PG_TXID_SNAPSHOTARRAY returns correct value');
-is(PG_UNKNOWN , 705, 'PG_UNKNOWN returns correct value');
-is(PG_UUID , 2950, 'PG_UUID returns correct value');
-is(PG_UUIDARRAY , 2951, 'PG_UUIDARRAY returns correct value');
-is(PG_VARBIT , 1562, 'PG_VARBIT returns correct value');
-is(PG_VARBITARRAY , 1563, 'PG_VARBITARRAY returns correct value');
-is(PG_VARCHAR , 1043, 'PG_VARCHAR returns correct value');
-is(PG_VARCHARARRAY , 1015, 'PG_VARCHARARRAY returns correct value');
-is(PG_VOID , 2278, 'PG_VOID returns correct value');
-is(PG_XID , 28, 'PG_XID returns correct value');
-is(PG_XIDARRAY , 1011, 'PG_XIDARRAY returns correct value');
-is(PG_XML , 142, 'PG_XML returns correct value');
-is(PG_XMLARRAY , 143, 'PG_XMLARRAY returns correct value');
+is (PG_ABSTIME , 702, 'PG_ABSTIME returns correct value');
+is (PG_ABSTIMEARRAY , 1023, 'PG_ABSTIMEARRAY returns correct value');
+is (PG_ACLITEM , 1033, 'PG_ACLITEM returns correct value');
+is (PG_ACLITEMARRAY , 1034, 'PG_ACLITEMARRAY returns correct value');
+is (PG_ANY , 2276, 'PG_ANY returns correct value');
+is (PG_ANYARRAY , 2277, 'PG_ANYARRAY returns correct value');
+is (PG_ANYELEMENT , 2283, 'PG_ANYELEMENT returns correct value');
+is (PG_ANYENUM , 3500, 'PG_ANYENUM returns correct value');
+is (PG_ANYNONARRAY , 2776, 'PG_ANYNONARRAY returns correct value');
+is (PG_BIT , 1560, 'PG_BIT returns correct value');
+is (PG_BITARRAY , 1561, 'PG_BITARRAY returns correct value');
+is (PG_BOOL , 16, 'PG_BOOL returns correct value');
+is (PG_BOOLARRAY , 1000, 'PG_BOOLARRAY returns correct value');
+is (PG_BOX , 603, 'PG_BOX returns correct value');
+is (PG_BOXARRAY , 1020, 'PG_BOXARRAY returns correct value');
+is (PG_BPCHAR , 1042, 'PG_BPCHAR returns correct value');
+is (PG_BPCHARARRAY , 1014, 'PG_BPCHARARRAY returns correct value');
+is (PG_BYTEA , 17, 'PG_BYTEA returns correct value');
+is (PG_BYTEAARRAY , 1001, 'PG_BYTEAARRAY returns correct value');
+is (PG_CHAR , 18, 'PG_CHAR returns correct value');
+is (PG_CHARARRAY , 1002, 'PG_CHARARRAY returns correct value');
+is (PG_CID , 29, 'PG_CID returns correct value');
+is (PG_CIDARRAY , 1012, 'PG_CIDARRAY returns correct value');
+is (PG_CIDR , 650, 'PG_CIDR returns correct value');
+is (PG_CIDRARRAY , 651, 'PG_CIDRARRAY returns correct value');
+is (PG_CIRCLE , 718, 'PG_CIRCLE returns correct value');
+is (PG_CIRCLEARRAY , 719, 'PG_CIRCLEARRAY returns correct value');
+is (PG_CSTRING , 2275, 'PG_CSTRING returns correct value');
+is (PG_CSTRINGARRAY , 1263, 'PG_CSTRINGARRAY returns correct value');
+is (PG_DATE , 1082, 'PG_DATE returns correct value');
+is (PG_DATEARRAY , 1182, 'PG_DATEARRAY returns correct value');
+is (PG_FLOAT4 , 700, 'PG_FLOAT4 returns correct value');
+is (PG_FLOAT4ARRAY , 1021, 'PG_FLOAT4ARRAY returns correct value');
+is (PG_FLOAT8 , 701, 'PG_FLOAT8 returns correct value');
+is (PG_FLOAT8ARRAY , 1022, 'PG_FLOAT8ARRAY returns correct value');
+is (PG_GTSVECTOR , 3642, 'PG_GTSVECTOR returns correct value');
+is (PG_GTSVECTORARRAY , 3644, 'PG_GTSVECTORARRAY returns correct value');
+is (PG_INET , 869, 'PG_INET returns correct value');
+is (PG_INETARRAY , 1041, 'PG_INETARRAY returns correct value');
+is (PG_INT2 , 21, 'PG_INT2 returns correct value');
+is (PG_INT2ARRAY , 1005, 'PG_INT2ARRAY returns correct value');
+is (PG_INT2VECTOR , 22, 'PG_INT2VECTOR returns correct value');
+is (PG_INT2VECTORARRAY , 1006, 'PG_INT2VECTORARRAY returns correct value');
+is (PG_INT4 , 23, 'PG_INT4 returns correct value');
+is (PG_INT4ARRAY , 1007, 'PG_INT4ARRAY returns correct value');
+is (PG_INT8 , 20, 'PG_INT8 returns correct value');
+is (PG_INT8ARRAY , 1016, 'PG_INT8ARRAY returns correct value');
+is (PG_INTERNAL , 2281, 'PG_INTERNAL returns correct value');
+is (PG_INTERVAL , 1186, 'PG_INTERVAL returns correct value');
+is (PG_INTERVALARRAY , 1187, 'PG_INTERVALARRAY returns correct value');
+is (PG_LANGUAGE_HANDLER , 2280, 'PG_LANGUAGE_HANDLER returns correct value');
+is (PG_LINE , 628, 'PG_LINE returns correct value');
+is (PG_LINEARRAY , 629, 'PG_LINEARRAY returns correct value');
+is (PG_LSEG , 601, 'PG_LSEG returns correct value');
+is (PG_LSEGARRAY , 1018, 'PG_LSEGARRAY returns correct value');
+is (PG_MACADDR , 829, 'PG_MACADDR returns correct value');
+is (PG_MACADDRARRAY , 1040, 'PG_MACADDRARRAY returns correct value');
+is (PG_MONEY , 790, 'PG_MONEY returns correct value');
+is (PG_MONEYARRAY , 791, 'PG_MONEYARRAY returns correct value');
+is (PG_NAME , 19, 'PG_NAME returns correct value');
+is (PG_NAMEARRAY , 1003, 'PG_NAMEARRAY returns correct value');
+is (PG_NUMERIC , 1700, 'PG_NUMERIC returns correct value');
+is (PG_NUMERICARRAY , 1231, 'PG_NUMERICARRAY returns correct value');
+is (PG_OID , 26, 'PG_OID returns correct value');
+is (PG_OIDARRAY , 1028, 'PG_OIDARRAY returns correct value');
+is (PG_OIDVECTOR , 30, 'PG_OIDVECTOR returns correct value');
+is (PG_OIDVECTORARRAY , 1013, 'PG_OIDVECTORARRAY returns correct value');
+is (PG_OPAQUE , 2282, 'PG_OPAQUE returns correct value');
+is (PG_PATH , 602, 'PG_PATH returns correct value');
+is (PG_PATHARRAY , 1019, 'PG_PATHARRAY returns correct value');
+is (PG_PG_ATTRIBUTE , 75, 'PG_PG_ATTRIBUTE returns correct value');
+is (PG_PG_CLASS , 83, 'PG_PG_CLASS returns correct value');
+is (PG_PG_PROC , 81, 'PG_PG_PROC returns correct value');
+is (PG_PG_TYPE , 71, 'PG_PG_TYPE returns correct value');
+is (PG_POINT , 600, 'PG_POINT returns correct value');
+is (PG_POINTARRAY , 1017, 'PG_POINTARRAY returns correct value');
+is (PG_POLYGON , 604, 'PG_POLYGON returns correct value');
+is (PG_POLYGONARRAY , 1027, 'PG_POLYGONARRAY returns correct value');
+is (PG_RECORD , 2249, 'PG_RECORD returns correct value');
+is (PG_REFCURSOR , 1790, 'PG_REFCURSOR returns correct value');
+is (PG_REFCURSORARRAY , 2201, 'PG_REFCURSORARRAY returns correct value');
+is (PG_REGCLASS , 2205, 'PG_REGCLASS returns correct value');
+is (PG_REGCLASSARRAY , 2210, 'PG_REGCLASSARRAY returns correct value');
+is (PG_REGCONFIG , 3734, 'PG_REGCONFIG returns correct value');
+is (PG_REGCONFIGARRAY , 3735, 'PG_REGCONFIGARRAY returns correct value');
+is (PG_REGDICTIONARY , 3769, 'PG_REGDICTIONARY returns correct value');
+is (PG_REGDICTIONARYARRAY , 3770, 'PG_REGDICTIONARYARRAY returns correct value');
+is (PG_REGOPER , 2203, 'PG_REGOPER returns correct value');
+is (PG_REGOPERARRAY , 2208, 'PG_REGOPERARRAY returns correct value');
+is (PG_REGOPERATOR , 2204, 'PG_REGOPERATOR returns correct value');
+is (PG_REGOPERATORARRAY , 2209, 'PG_REGOPERATORARRAY returns correct value');
+is (PG_REGPROC , 24, 'PG_REGPROC returns correct value');
+is (PG_REGPROCARRAY , 1008, 'PG_REGPROCARRAY returns correct value');
+is (PG_REGPROCEDURE , 2202, 'PG_REGPROCEDURE returns correct value');
+is (PG_REGPROCEDUREARRAY , 2207, 'PG_REGPROCEDUREARRAY returns correct value');
+is (PG_REGTYPE , 2206, 'PG_REGTYPE returns correct value');
+is (PG_REGTYPEARRAY , 2211, 'PG_REGTYPEARRAY returns correct value');
+is (PG_RELTIME , 703, 'PG_RELTIME returns correct value');
+is (PG_RELTIMEARRAY , 1024, 'PG_RELTIMEARRAY returns correct value');
+is (PG_SMGR , 210, 'PG_SMGR returns correct value');
+is (PG_TEXT , 25, 'PG_TEXT returns correct value');
+is (PG_TEXTARRAY , 1009, 'PG_TEXTARRAY returns correct value');
+is (PG_TID , 27, 'PG_TID returns correct value');
+is (PG_TIDARRAY , 1010, 'PG_TIDARRAY returns correct value');
+is (PG_TIME , 1083, 'PG_TIME returns correct value');
+is (PG_TIMEARRAY , 1183, 'PG_TIMEARRAY returns correct value');
+is (PG_TIMESTAMP , 1114, 'PG_TIMESTAMP returns correct value');
+is (PG_TIMESTAMPARRAY , 1115, 'PG_TIMESTAMPARRAY returns correct value');
+is (PG_TIMESTAMPTZ , 1184, 'PG_TIMESTAMPTZ returns correct value');
+is (PG_TIMESTAMPTZARRAY , 1185, 'PG_TIMESTAMPTZARRAY returns correct value');
+is (PG_TIMETZ , 1266, 'PG_TIMETZ returns correct value');
+is (PG_TIMETZARRAY , 1270, 'PG_TIMETZARRAY returns correct value');
+is (PG_TINTERVAL , 704, 'PG_TINTERVAL returns correct value');
+is (PG_TINTERVALARRAY , 1025, 'PG_TINTERVALARRAY returns correct value');
+is (PG_TRIGGER , 2279, 'PG_TRIGGER returns correct value');
+is (PG_TSQUERY , 3615, 'PG_TSQUERY returns correct value');
+is (PG_TSQUERYARRAY , 3645, 'PG_TSQUERYARRAY returns correct value');
+is (PG_TSVECTOR , 3614, 'PG_TSVECTOR returns correct value');
+is (PG_TSVECTORARRAY , 3643, 'PG_TSVECTORARRAY returns correct value');
+is (PG_TXID_SNAPSHOT , 2970, 'PG_TXID_SNAPSHOT returns correct value');
+is (PG_TXID_SNAPSHOTARRAY , 2949, 'PG_TXID_SNAPSHOTARRAY returns correct value');
+is (PG_UNKNOWN , 705, 'PG_UNKNOWN returns correct value');
+is (PG_UUID , 2950, 'PG_UUID returns correct value');
+is (PG_UUIDARRAY , 2951, 'PG_UUIDARRAY returns correct value');
+is (PG_VARBIT , 1562, 'PG_VARBIT returns correct value');
+is (PG_VARBITARRAY , 1563, 'PG_VARBITARRAY returns correct value');
+is (PG_VARCHAR , 1043, 'PG_VARCHAR returns correct value');
+is (PG_VARCHARARRAY , 1015, 'PG_VARCHARARRAY returns correct value');
+is (PG_VOID , 2278, 'PG_VOID returns correct value');
+is (PG_XID , 28, 'PG_XID returns correct value');
+is (PG_XIDARRAY , 1011, 'PG_XIDARRAY returns correct value');
+is (PG_XML , 142, 'PG_XML returns correct value');
+is (PG_XMLARRAY , 143, 'PG_XMLARRAY returns correct value');
Modified: DBD-Pg/trunk/t/02attribs.t
==============================================================================
--- DBD-Pg/trunk/t/02attribs.t (original)
+++ DBD-Pg/trunk/t/02attribs.t Sun Jul 6 18:37:54 2008
@@ -247,7 +247,7 @@
is ($@, q{}, $t);
$t='DB handle attribute "PrintWarn" shows warnings when on';
-like($warning, qr{dbd_pg_test_temp}, $t);
+like ($warning, qr{dbd_pg_test_temp}, $t);
$t='DB handle attribute "PrintWarn" works when on';
@@ -665,22 +665,22 @@
$t='Statement handle attribute "Active" is false before SELECT';
$sth = $dbh->prepare('SELECT 123 UNION SELECT 456');
$attrib = $sth->{Active};
-is($attrib, '', $t);
+is ($attrib, '', $t);
$t='Statement handle attribute "Active" is true after SELECT';
$sth->execute();
$attrib = $sth->{Active};
-is($attrib, 1, $t);
+is ($attrib, 1, $t);
$t='Statement handle attribute "Active" is true when rows remaining';
my $row = $sth->fetchrow_arrayref();
$attrib = $sth->{Active};
-is($attrib, 1, $t);
+is ($attrib, 1, $t);
$t='Statement handle attribute "Active" is false after finish called';
$sth->finish();
$attrib = $sth->{Active};
-is($attrib, '', $t);
+is ($attrib, '', $t);
#
# Test of the handle attribute "Kids"
@@ -723,7 +723,7 @@
$t='Database handle attribute "CachedKids" is set properly';
$attrib = $dbh->{CachedKids};
-is(keys %$attrib, 2, $t);
+is (keys %$attrib, 2, $t);
#
# Test of the handle attribute "CompatMode"
@@ -771,7 +771,7 @@
$dbh->{PrintError} = 1;
$sth = $dbh->prepare($SQL);
$sth->execute();
- isnt( $warning, undef, $t);
+ isnt ($warning, undef, $t);
$t='No warning thrown when database handle attribute "PrintError" is off';
undef $warning;
@@ -801,7 +801,7 @@
$sth = $dbh->prepare($SQL);
$sth->execute();
};
- isnt( $@, q{}, $t);
+ isnt ($@, q{}, $t);
}
@@ -829,7 +829,7 @@
$sth = $dbh->prepare($SQL);
$sth->execute();
};
- like($@, qr/^Slonik/, $t);
+ like ($@, qr/^Slonik/, $t);
$dbh->{HandleError}= undef;
$dbh->rollback();
}
@@ -845,7 +845,7 @@
$t='Database handle attribute "TraceLevel" returns a number';
$attrib = $dbh->{TraceLevel};
-like($attrib, qr/^\d$/, $t);
+like ($attrib, qr/^\d$/, $t);
#
# Test of the handle attribute FetchHashKeyName
@@ -1028,7 +1028,7 @@
if ($destroy) {
$t=qq{Ping works after the child has exited ("InactiveDestroy" = $destroy)};
- ok ( $dbh->ping(), $t);
+ ok ($dbh->ping(), $t);
$t='Successful ping returns a SQLSTATE code of 00000 (empty string)';
my $state = $dbh->state();
Modified: DBD-Pg/trunk/t/03dbmethod.t
==============================================================================
--- DBD-Pg/trunk/t/03dbmethod.t (original)
+++ DBD-Pg/trunk/t/03dbmethod.t Sun Jul 6 18:37:54 2008
@@ -161,8 +161,8 @@
eval {
$result = $dbh->last_insert_id(undef,undef,$table2,undef,{pg_cache=>0});
};
-is($@, q{}, $t);
-is($result, 100, $t);
+is ($@, q{}, $t);
+is ($result, 100, $t);
$t='search_path respected when using last_insert_id with no cache (second table)';
$dbh->commit();
@@ -170,8 +170,8 @@
eval {
$result = $dbh->last_insert_id(undef,undef,$table2,undef,{pg_cache=>0});
};
-is($@, q{}, $t);
-is($result, 200, $t);
+is ($@, q{}, $t);
+is ($result, 200, $t);
$t='Setting cache on (explicit) returns last result, even if search_path changes';
$dbh->do("SET search_path = $schema,$schema2,public");
@@ -440,11 +440,11 @@
$t='DB handle method "get_info" returns correct string for SQL_DATA_SOURCE_READ_ONLY when "on"';
$dbh->do(q{SET transaction_read_only = 'on'});
-is($dbh->get_info(25), 'Y', $t);
+is ($dbh->get_info(25), 'Y', $t);
$t='DB handle method "get_info" returns correct string for SQL_DATA_SOURCE_READ_ONLY when "off"';
$dbh->do(q{SET transaction_read_only = 'off'});
-is($dbh->get_info(25), 'N', $t);
+is ($dbh->get_info(25), 'N', $t);
#
# Test of the "table_info" database handle method
Modified: DBD-Pg/trunk/t/04misc.t
==============================================================================
--- DBD-Pg/trunk/t/04misc.t (original)
+++ DBD-Pg/trunk/t/04misc.t Sun Jul 6 18:37:54 2008
@@ -19,58 +19,62 @@
}
plan tests => 54;
-isnt( $dbh, undef, 'Connect to database for miscellaneous tests');
+isnt ($dbh, undef, 'Connect to database for miscellaneous tests');
my $t = q{Method 'server_trace_flag' is available without a database handle};
my $num;
eval {
$num = DBD::Pg->parse_trace_flag('NONE');
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
-$t = q{Method 'server_trace_flag' returns undef on bogus argument};
-is( $num, undef, $t);
+$t='Method "server_trace_flag" returns undef on bogus argument';
+is ($num, undef, $t);
-$t = q{Method 'server_trace_flag' returns 0x00000100 for DBI value 'SQL'};
+$t=q{Method "server_trace_flag" returns 0x00000100 for DBI value 'SQL'};
$num = DBD::Pg->parse_trace_flag('SQL');
-is( $num, 0x00000100, $t);
+is ($num, 0x00000100, $t);
-$t = q{Method 'server_trace_flag' returns 0x01000000 for DBD::Pg flag 'pglibpq'};
+$t=q{Method "server_trace_flag" returns 0x01000000 for DBD::Pg flag 'pglibpq'};
$num = DBD::Pg->parse_trace_flag('pglibpq');
-is( $num, 0x01000000, $t);
+is ($num, 0x01000000, $t);
-$t = q{Database handle method 'server_trace_flag' returns undef on bogus argument};
+$t=q{Database handle method "server_trace_flag" returns undef on bogus argument};
$num = $dbh->parse_trace_flag('NONE');
-is( $num, undef, $t);
+is ($num, undef, $t);
-$t = q{Database handle method 'server_trace_flag' returns 0x00000100 for DBI value 'SQL'};
+$t=q{Database handle method "server_trace_flag" returns 0x00000100 for DBI value 'SQL'};
$num = $dbh->parse_trace_flag('SQL');
-is( $num, 0x00000100, $t);
+is ($num, 0x00000100, $t);
-$t = q{Database handle method 'server_trace_flags' returns 0x01000100 for 'SQL|pglibpq'};
+$t=q{Database handle method 'server_trace_flags' returns 0x01000100 for 'SQL|pglibpq'};
$num = $dbh->parse_trace_flags('SQL|pglibpq');
-is( $num, 0x01000100, $t);
+is ($num, 0x01000100, $t);
-$t = q{Database handle method 'server_trace_flags' returns 0x03000100 for 'SQL|pglibpq|pgstart'};
+$t=q{Database handle method 'server_trace_flags' returns 0x03000100 for 'SQL|pglibpq|pgstart'};
$num = $dbh->parse_trace_flags('SQL|pglibpq|pgstart');
-is( $num, 0x03000100, $t);
+is ($num, 0x03000100, $t);
my $flagexp = 24;
my $sth = $dbh->prepare('SELECT 1');
for my $flag (qw/pglibpq pgstart pgend pgprefix pglogin pgquote/) {
+
my $hex = 2**$flagexp++;
- $t = qq{Database handle method 'server_trace_flag' returns $hex for flag $flag};
+ $t = qq{Database handle method "server_trace_flag" returns $hex for flag $flag};
$num = $dbh->parse_trace_flag($flag);
- is( $num, $hex, $t);
+ is ($num, $hex, $t);
+
$t = qq{Database handle method 'server_trace_flags' returns $hex for flag $flag};
$num = $dbh->parse_trace_flags($flag);
- is( $num, $hex, $t);
- $t = qq{Statement handle method 'server_trace_flag' returns $hex for flag $flag};
+ is ($num, $hex, $t);
+
+ $t = qq{Statement handle method "server_trace_flag" returns $hex for flag $flag};
$num = $sth->parse_trace_flag($flag);
- is( $num, $hex, $t);
+ is ($num, $hex, $t);
+
$t = qq{Statement handle method 'server_trace_flags' returns $hex for flag $flag};
$num = $sth->parse_trace_flag($flag);
- is( $num, $hex, $t);
+ is ($num, $hex, $t);
}
SKIP: {
@@ -78,7 +82,7 @@
eval {
require File::Temp;
};
- $@ and skip q{Must have File::Temp to complete trace flag testing}, 9;
+ $@ and skip ('Must have File::Temp to complete trace flag testing', 9);
my ($fh,$filename) = File::Temp::tempfile('dbdpg_test_XXXXXX', SUFFIX => 'tst', UNLINK => 1);
my ($flag, $info, $expected, $SQL);
@@ -93,7 +97,7 @@
seek $fh,0,0;
{ local $/; ($info = <$fh>) =~ s/\r//go; }
$expected = qq{begin;\n\n$SQL;\n\ncommit;\n\n};
- is($info, $expected, $t);
+ is ($info, $expected, $t);
$t=q{Trace flag 'pglibpq' works as expected};
seek $fh, 0, 0;
@@ -120,7 +124,7 @@
PQresultErrorField
PQclear
};
- is($info, $expected, $t);
+ is ($info, $expected, $t);
$t=q{Trace flag 'pgstart' works as expected};
seek $fh, 0, 0;
@@ -141,7 +145,7 @@
Begin _result (sql: commit)
Begin _sqlstate
};
- is($info, $expected, $t);
+ is ($info, $expected, $t);
$t=q{Trace flag 'pgprefix' works as expected};
seek $fh, 0, 0;
@@ -162,7 +166,7 @@
dbdpg: Begin _result (sql: commit)
dbdpg: Begin _sqlstate
};
- is($info, $expected, $t);
+ is ($info, $expected, $t);
$t=q{Trace flag 'pgend' works as expected};
seek $fh, 0, 0;
@@ -184,7 +188,7 @@
End _result
End pg_db_rollback_commit (result: 1)
};
- is($info, $expected, $t);
+ is ($info, $expected, $t);
$t=q{Trace flag 'pglogin' returns undef if no activity};
seek $fh, 0, 0;
@@ -196,7 +200,7 @@
seek $fh,0,0;
{ local $/; $info = <$fh>; }
$expected = undef;
- is($info, $expected, $t);
+ is ($info, $expected, $t);
$t=q{Trace flag 'pglogin' works as expected with DBD::Pg->parse_trace_flag()};
$dbh->disconnect();
@@ -217,7 +221,7 @@
Disconnection complete
};
$info =~ s/(Login connection string: ).+/$1/g;
- is($info, "$expected$expected", $t);
+ is ($info, "$expected$expected", $t);
$t=q{Trace flag 'pglogin' works as expected with DBD::Pg->parse_trace_flag()};
seek $fh, 0, 0;
@@ -233,7 +237,7 @@
Disconnection complete
};
$info =~ s/(Login connection string: ).+/$1/g;
- is($info, "$expected", $t);
+ is ($info, "$expected", $t);
$t=q{Trace flag 'pgprefix' and 'pgstart' appended to 'pglogin' work as expected};
seek $fh, 0, 0;
@@ -254,7 +258,7 @@
dbdpg: Begin _sqlstate
};
$info =~ s/(Login connection string: ).+/$1/g;
- is($info, "$expected", $t);
+ is ($info, "$expected", $t);
} ## end trace flag testing using File::Temp
@@ -262,71 +266,72 @@
# Test of the "data_sources" method
#
+$t='The "data_sources" method did not throw an exception';
my @result;
eval {
@result = DBI->data_sources('Pg');
};
-is( $@, q{}, 'The data_sources() method did not throw an exception');
+is ($@, q{}, $t);
+$t='The "data_sources" method returns a template1 listing';
if (! defined $result[0]) {
- fail 'The data_sources() method returned an empty list';
+ fail ('The data_sources() method returned an empty list');
}
else {
- is( grep (/^dbi:Pg:dbname=template1$/, @result), '1', 'The data_sources() method returns a template1 listing');
+ is (grep (/^dbi:Pg:dbname=template1$/, @result), '1', $t);
}
-$t=q{The data_sources() returns undef when fed a bogus second argument};
+$t='The "data_sources" method returns undef when fed a bogus second argument';
@result = DBI->data_sources('Pg','foobar');
-is_deeply( @result, undef, $t);
+is_deeply (@result, undef, $t);
+$t='The "data_sources" method returns information when fed a valid port as the second arg';
my $port = $dbh->{pg_port};
-
-$t=q{The data_sources() returns information when fed a valid port as the second arg};
@result = DBI->data_sources('Pg',"port=$port");
-isnt( $result[0], undef, $t);
+isnt ($result[0], undef, $t);
#
# Test the use of $DBDPG_DEFAULT
#
+$t=qq{Using \$DBDPG_DEFAULT ($DBDPG_DEFAULT) works};
$sth = $dbh->prepare(q{INSERT INTO dbd_pg_test (id, pname) VALUES (?,?)});
eval {
$sth->execute(600,$DBDPG_DEFAULT);
};
$sth->execute(602,123);
-is( $@, q{}, qq{Using \$DBDPG_DEFAULT ($DBDPG_DEFAULT) works});
+is ($@, q{}, $t);
#
# Test transaction status changes
#
+$t='Raw ROLLBACK via do() resets the transaction status correctly';
$dbh->{AutoCommit} = 1;
$dbh->begin_work();
$dbh->do('SELECT 123');
-
-$t = q{Raw ROLLBACK via do() resets the transaction status correctly};
eval { $dbh->do('ROLLBACK'); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
eval { $dbh->begin_work(); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
-$t = q{Using dbh->commit() resets the transaction status correctly};
+$t='Using dbh->commit() resets the transaction status correctly';
eval { $dbh->commit(); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
eval { $dbh->begin_work(); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
-$t = q{Raw COMMIT via do() resets the transaction status correctly};
+$t='Raw COMMIT via do() resets the transaction status correctly';
eval { $dbh->do('COMMIT'); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
eval { $dbh->begin_work(); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
-$t = q{Calling COMMIT via prepare/execute resets the transaction status correctly};
+$t='Calling COMMIT via prepare/execute resets the transaction status correctly';
$sth = $dbh->prepare('COMMIT');
$sth->execute();
eval { $dbh->begin_work(); };
-is( $@, q{}, $t);
+is ($@, q{}, $t);
cleanup_database($dbh,'test');
$dbh->disconnect();
Modified: DBD-Pg/trunk/t/06bytea.t
==============================================================================
--- DBD-Pg/trunk/t/06bytea.t (original)
+++ DBD-Pg/trunk/t/06bytea.t Sun Jul 6 18:37:54 2008
@@ -18,37 +18,44 @@
}
plan tests => 7;
-isnt( $dbh, undef, 'Connect to database for bytea testing');
+isnt ($dbh, undef, 'Connect to database for bytea testing');
my ($pglibversion,$pgversion) = ($dbh->{pg_lib_version},$dbh->{pg_server_version});
if ($pgversion >= 80100) {
$dbh->do('SET escape_string_warning = false');
}
-my $sth;
+my ($sth, $t);
$sth = $dbh->prepare(q{INSERT INTO dbd_pg_test (id,bytetest) VALUES (?,?)});
+$t='bytea insert test with string containing null and backslashes';
$sth->bind_param(2, undef, { pg_type => PG_BYTEA });
-ok( $sth->execute(400, 'aa\\bb\\cc\\\0dd\\'), 'bytea insert test with string containing null and backslashes');
-ok( $sth->execute(401, '\''), 'bytea insert test with string containing a single quote');
-ok( $sth->execute(402, '\''), 'bytea (second) insert test with string containing a single quote');
+ok ($sth->execute(400, 'aa\\bb\\cc\\\0dd\\'), $t);
-$sth = $dbh->prepare(q{SELECT bytetest FROM dbd_pg_test WHERE id=?});
+$t='bytea insert test with string containing a single quote';
+ok ($sth->execute(401, '\''), $t);
+
+$t='bytea (second) insert test with string containing a single quote';
+ok ($sth->execute(402, '\''), $t);
+$t='Received correct text from BYTEA column with backslashes';
+$sth = $dbh->prepare(q{SELECT bytetest FROM dbd_pg_test WHERE id=?});
$sth->execute(400);
my $byte = $sth->fetchall_arrayref()->[0][0];
-is( $byte, 'aa\bb\cc\\\0dd\\', 'Received correct text from BYTEA column with backslashes');
+is ($byte, 'aa\bb\cc\\\0dd\\', $t);
+$t='Received correct text from BYTEA column with quote';
$sth->execute(402);
$byte = $sth->fetchall_arrayref()->[0][0];
-is( $byte, '\'', 'Received correct text from BYTEA column with quote');
+is ($byte, '\'', $t);
+$t='quote properly handles bytea strings';
my $string = "abc\123\\def\0ghi";
my $result = $dbh->quote($string, { pg_type => PG_BYTEA });
my $E = $pgversion >= 80100 ? q{E} : q{};
my $expected = qq{${E}'abc\123\\\\\\\\def\\\\000ghi'};
-is( $result, $expected, 'quote properly handles bytea strings.');
+is ($result, $expected, $t);
$sth->finish();
Modified: DBD-Pg/trunk/t/07copy.t
==============================================================================
--- DBD-Pg/trunk/t/07copy.t (original)
+++ DBD-Pg/trunk/t/07copy.t Sun Jul 6 18:37:54 2008
@@ -19,9 +19,9 @@
plan skip_all => 'Connection to database failed, cannot continue testing';
}
-ok( defined $dbh, 'Connect to database for bytea testing');
+ok (defined $dbh, 'Connect to database for bytea testing');
-my ($sth,$count,$result,$expected,@data);
+my ($sth,$count,$result,$expected,@data,$t);
my $table = 'dbd_pg_test4';
$dbh->do(qq{CREATE TABLE $table(id2 integer, val2 text)});
@@ -33,54 +33,66 @@
#
## pg_putline should fail unless we are in a COPY IN state
+$t='pg_putline fails when issued without a preceding COPY command';
eval {
$dbh->pg_putline("12\tMulberry");
};
-ok($@, 'pg_putline fails when issued without a preceding COPY command');
+ok ($@, $t);
+$t='putline returned a value of 1 for success';
$dbh->do("COPY $table FROM STDIN");
$result = $dbh->pg_putline("12\tMulberry\n");
-is($result,1,'putline returned a value of 1 for success');
+is ($result, 1, $t);
+
+$t='putline returned a value of 1 for success';
$result = $dbh->pg_putline("13\tStrawberry\n");
-is($result,1,'putline returned a value of 1 for success');
+is ($result, 1, $t);
+
+$t='putline returned a value of 1 for success';
$result = $dbh->pg_putline("14\tBlueberry\n");
-is($result,1,'putline returned a value of 1 for success');
+is ($result, 1, $t);
## Commands are not allowed while in a COPY IN state
+$t='do() fails while in a COPY IN state';
eval {
$dbh->do(q{SELECT 'dbdpg_copytest'});
};
-ok($@, 'do() fails while in a COPY IN state');
+ok ($@, $t);
## pg_getline is not allowed as we are in a COPY_IN state
+$t='pg_getline fails while in a COPY IN state';
$data[0] = '';
eval {
$dbh->pg_getline($data[0], 100);
};
-ok($@, 'pg_getline fails while in a COPY IN state');
+ok ($@, $t);
+$t='pg_endcopy returned a 1';
$result = $dbh->pg_endcopy();
-is($result,1,'pg_endcopy returned a 1');
+is ($result, 1, $t);
## Make sure we can issue normal commands again
$dbh->do(q{SELECT 'dbdpg_copytest'});
## Make sure we are out of the COPY IN state and pg_putline no longer works
+$t='pg_putline fails when issued after pg_endcopy called';
eval {
$dbh->pg_putline("16\tBlackberry");
};
-ok($@, 'pg_putline fails when issued after pg_endcopy called');
+ok ($@, $t);
## Check that our lines were inserted properly
+$t='putline inserted values correctly';
$expected = [[12 => 'Mulberry'],[13 => 'Strawberry'],[14 => 'Blueberry']];
$result = $dbh->selectall_arrayref("SELECT id2,val2 FROM $table ORDER BY id2");
-is_deeply( $result, $expected, 'putline inserted values correctly');
+is_deeply ($result, $expected, $t);
# pg_endcopy should not work because we are no longer in a COPY state
+$t='pg_endcopy fails when called twice after COPY IN';
eval {
$dbh->pg_endcopy;
};
-ok($@, 'pg_endcopy fails when called twice after COPY IN');
+ok ($@, $t);
$dbh->commit();
@@ -89,56 +101,67 @@
#
## pg_getline should fail unless we are in a COPY OUT state
+$t='pg_getline fails when issued without a preceding COPY command';
eval {
$dbh->pg_getline($data[0], 100);
};
-ok($@, 'pg_getline fails when issued without a preceding COPY command');
+ok ($@, $t);
+$t='pg_getline returns a 1';
$dbh->do("COPY $table TO STDOUT");
my ($buffer,$badret,$badval) = ('',0,0);
$result = $dbh->pg_getline($data[0], 100);
-is ($result, 1, 'pg_getline returned a 1');
+is ($result, 1, $t);
## Commands are not allowed while in a COPY OUT state
+$t='do() fails while in a COPY OUT state';
eval {
$dbh->do(q{SELECT 'dbdpg_copytest'});
};
-ok($@, 'do() fails while in a COPY OUT state');
+ok ($@, $t);
## pg_putline is not allowed as we are in a COPY OUT state
+$t='pg_putline fails while in a COPY OUT state';
eval {
$dbh->pg_putline("99\tBogusberry");
};
-ok($@, 'pg_putline fails while in a COPY OUT state');
+ok ($@, $t);
+$t='pg_getline returned a 1';
$data[1]=$data[2]=$data[3]='';
$result = $dbh->pg_getline($data[1], 100);
-is ($result, 1, 'pg_getline returned a 1');
+is ($result, 1, $t);
+
+$t='pg_getline returned a 1';
$result = $dbh->pg_getline($data[2], 100);
-is ($result, 1, 'pg_getline returned a 1');
+is ($result, 1, $t);
+$t='pg_getline returns empty on final call';
$result = $dbh->pg_getline($data[3], 100);
-is ($result, '', 'pg_getline returns empty on final call');
+is ($result, '', $t);
+$t='getline returned all rows successfuly';
$result = \@data;
$expected = ["12\tMulberry\n","13\tStrawberry\n","14\tBlueberry\n",''];
-is_deeply( $result, $expected, 'getline returned all rows successfuly');
+is_deeply ($result, $expected, $t);
## Make sure we can issue normal commands again
$dbh->do(q{SELECT 'dbdpg_copytest'});
## Make sure we are out of the COPY OUT state and pg_getline no longer works
+$t='pg_getline fails when issued after pg_endcopy called';
eval {
$data[5]='';
$dbh->pg_getline($data[5], 100);
};
-ok($@, 'pg_getline fails when issued after pg_endcopy called');
+ok ($@, $t);
## pg_endcopy should fail because we are no longer in a COPY state
+$t='pg_endcopy fails when called twice after COPY OUT';
eval {
$dbh->pg_endcopy;
};
-ok($@, 'pg_endcopy fails when called twice after COPY OUT');
+ok ($@, $t);
##
@@ -147,204 +170,209 @@
$dbh->do("DELETE FROM $table");
-my $t=q{pg_putcopydata fails if not after a COPY statement};
+$t='pg_putcopydata fails if not after a COPY statement';
eval {
$dbh->pg_putcopydata("pizza\tpie");
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{pg_getcopydata fails if not after a COPY statement};
+$t='pg_getcopydata fails if not after a COPY statement';
eval {
$dbh->pg_getcopydata($data[0]);
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{pg_getcopydata_async fails if not after a COPY statement};
+$t='pg_getcopydata_async fails if not after a COPY statement';
eval {
$dbh->pg_getcopydata_async($data[0]);
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{pg_putcopyend warns but does not die if not after a COPY statement};
+$t='pg_putcopyend warns but does not die if not after a COPY statement';
eval { require Test::Warn; };
if ($@) {
- pass('Skipping Test::Warn test');
+ pass ('Skipping Test::Warn test');
}
else {
Test::Warn::warning_like (sub { $dbh->pg_putcopyend(); }, qr/until a COPY/, $t);
}
-$t=q{pg_getcopydata does not work if we are using COPY .. FROM};
+$t='pg_getcopydata does not work if we are using COPY .. FROM';
$dbh->rollback();
$dbh->do("COPY $table FROM STDIN");
eval {
$dbh->pg_getcopydata($data[0]);
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{pg_putcopydata does not work if we are using COPY .. TO};
+$t='pg_putcopydata does not work if we are using COPY .. TO';
$dbh->rollback();
$dbh->do("COPY $table TO STDOUT");
eval {
$dbh->pg_putcopydata("pizza\tpie");
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{pg_putcopydata works and returns a 1 on success};
+$t='pg_putcopydata works and returns a 1 on success';
$dbh->rollback();
$dbh->do("COPY $table FROM STDIN");
$result = $dbh->pg_putcopydata("15\tBlueberry");
is ($result, 1, $t);
-$t=q{pg_putcopydata works on second call};
+$t='pg_putcopydata works on second call';
$dbh->rollback();
$dbh->do("COPY $table FROM STDIN");
$result = $dbh->pg_putcopydata("16\tMoreBlueberries");
is ($result, 1, $t);
-$t=q{pg_putcopydata fails with invalid data};
+$t='pg_putcopydata fails with invalid data';
$dbh->rollback();
$dbh->do("COPY $table FROM STDIN");
eval {
$dbh->pg_putcopydata();
};
-ok($@, $t);
+ok ($@, $t);
-$t=q{Calling pg_getcopydata gives an error when in the middle of COPY .. FROM};
+$t='Calling pg_getcopydata gives an error when in the middle of COPY .. FROM';
eval {
$dbh->pg_getcopydata($data[0]);
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{Calling do() gives an error when in the middle of COPY .. FROM};
+$t='Calling do() gives an error when in the middle of COPY .. FROM';
eval {
$dbh->do('SELECT 123');
};
-like($@, qr{call pg_putcopyend}, $t);
+like ($@, qr{call pg_putcopyend}, $t);
-$t=q{pg_putcopydata works after a rude non-COPY attempt};
+$t='pg_putcopydata works after a rude non-COPY attempt';
eval {
$result = $dbh->pg_putcopydata("17\tMoreBlueberries");
};
-is($@, q{}, $t);
+is ($@, q{}, $t);
is ($result, 1, $t);
-$t=q{pg_putcopyend works and returns a 1};
+$t='pg_putcopyend works and returns a 1';
eval {
$result = $dbh->pg_putcopyend();
};
-is($@, q{}, $t);
+is ($@, q{}, $t);
is ($result, 1, $t);
+$t='pg_putcopydata fails after pg_putcopyend is called';
$dbh->commit();
-$t=q{pg_putcopydata fails after pg_putcopyend is called};
eval {
$result = $dbh->pg_putcopydata('root');
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{Normal queries work after pg_putcopyend is called};
+$t='Normal queries work after pg_putcopyend is called';
eval {
$dbh->do('SELECT 123');
};
-is($@, q{}, $t);
+is ($@, q{}, $t);
-$t=q{Data from pg_putcopydata was entered correctly};
+$t='Data from pg_putcopydata was entered correctly';
$result = $dbh->selectall_arrayref("SELECT id2,val2 FROM $table ORDER BY id2");
$expected = [['12','Mulberry'],['13','Strawberry'],[14,'Blueberry'],[17,'MoreBlueberries']];
-is_deeply($result, $expected, $t);
+is_deeply ($result, $expected, $t);
+$t='pg_getcopydata fails when argument is not a variable';
$dbh->do("COPY $table TO STDOUT");
-$t=q{pg_getcopydata fails when argument is not a variable};
eval {
$dbh->pg_getcopydata('wrongo');
};
-like($@, qr{read-only}, $t);
+like ($@, qr{read-only}, $t);
-$t=q{pg_getcopydata works and returns the length of the string};
+$t='pg_getcopydata works and returns the length of the string';
$data[0] = 'old';
eval {
$dbh->pg_getcopydata($data[0]);
};
-is($@, q{}, $t);
-is($data[0], "13\tStrawberry\n", $t);
+is ($@, q{}, $t);
+is ($data[0], "13\tStrawberry\n", $t);
-$t=q{pg_getcopydata works when argument is a reference};
+$t='pg_getcopydata works when argument is a reference';
eval {
$dbh->pg_getcopydata(\$data[0]);
};
-is($@, q{}, $t);
-is($data[0], "14\tBlueberry\n", $t);
+is ($@, q{}, $t);
+is ($data[0], "14\tBlueberry\n", $t);
-$t=q{Calling do() gives an error when in the middle of COPY .. TO};
+$t='Calling do() gives an error when in the middle of COPY .. TO';
eval {
$dbh->do('SELECT 234');
};
-like($@, qr{pg_getcopydata}, $t);
+like ($@, qr{pg_getcopydata}, $t);
-$t=q{Calling pg_putcopydata gives an errors when in the middle of COPY .. TO};
+$t='Calling pg_putcopydata gives an errors when in the middle of COPY .. TO';
eval {
$dbh->pg_putcopydata('pie');
};
-like($@, qr{COPY command}, $t);
+like ($@, qr{COPY command}, $t);
-$t=q{pg_getcopydata returns 0 when no more data};
+$t='pg_getcopydata returns 0 when no more data';
$dbh->pg_getcopydata(\$data[0]);
eval {
$result = $dbh->pg_getcopydata(\$data[0]);
};
-is($@, q{}, $t);
-is($data[0], '', $t);
-is($result, -1, $t);
+is ($@, q{}, $t);
+is ($data[0], '', $t);
+is ($result, -1, $t);
-$t=q{Normal queries work after pg_getcopydata runs out};
+$t='Normal queries work after pg_getcopydata runs out';
eval {
$dbh->do('SELECT 234');
};
-is($@, q{}, $t);
+is ($@, q{}, $t);
SKIP: {
- $pgversion < 80200 and skip 'Server version 8.2 or greater needed for test', 1;
- $t=q{pg_getcopydata works when pulling from an empty table into an empty var};
+ $pgversion < 80200 and skip ('Server version 8.2 or greater needed for test', 1);
+
+ $t='pg_getcopydata works when pulling from an empty table into an empty var';
$dbh->do(q{COPY (SELECT 1 FROM pg_class LIMIT 0) TO STDOUT});
eval {
my $newvar;
$dbh->pg_getcopydata($newvar);
};
- is($@, q{}, $t);
+ is ($@, q{}, $t);
};
#
# Make sure rollback and commit reset our internal copystate tracking
#
+$t='commit resets COPY state';
$dbh->do("COPY $table TO STDOUT");
$dbh->commit();
eval {
$dbh->do(q{SELECT 'dbdpg_copytest'});
};
-ok(!$@, 'commit resets COPY state');
+ok (!$@, $t);
+$t='rollback resets COPY state';
$dbh->do("COPY $table TO STDOUT");
$dbh->rollback();
eval {
$dbh->do(q{SELECT 'dbdpg_copytest'});
};
-ok(!$@, 'rollback resets COPY state');
+ok (!$@, $t);
#
# Keep old-style calls around for backwards compatibility
#
+$t=q{old-style dbh->func('text', 'putline') still works};
$dbh->do("COPY $table FROM STDIN");
$result = $dbh->func("13\tOlive\n", 'putline');
-is ($result, 1, q{old-style dbh->func('text', 'putline') still works});
-$dbh->pg_endcopy;
+is ($result, 1, $t);
+$t=q{old-style dbh->func(var, length, 'getline') still works};
+$dbh->pg_endcopy;
$dbh->do("COPY $table TO STDOUT");
$result = $dbh->func($data[0], 100, 'getline');
-is ($result, 1, q{old-style dbh->func(var, length, 'getline') still works});
+is ($result, 1, $t);
1 while ($result = $dbh->func($data[0], 100, 'getline'));
$dbh->do("DROP TABLE $table");
Modified: DBD-Pg/trunk/t/08async.t
==============================================================================
--- DBD-Pg/trunk/t/08async.t (original)
+++ DBD-Pg/trunk/t/08async.t Sun Jul 6 18:37:54 2008
@@ -27,7 +27,7 @@
plan tests => 67;
-isnt( $dbh, undef, 'Connect to database for async testing');
+isnt ($dbh, undef, 'Connect to database for async testing');
my ($t,$sth,$count,$res,$expected,@data);
my $pgversion = $dbh->{pg_server_version};
@@ -40,75 +40,75 @@
eval {
$res = $dbh->do('SELECT 123');
};
-is( $@, q{}, $t);
-is( $res, 1, $t);
+is ($@, q{}, $t);
+is ($res, 1, $t);
$t=q{Method do() works as expected with an unused attribute };
eval {
$res = $dbh->do('SELECT 123', {pg_nosuch => 'arg'});
};
-is( $@, q{}, $t);
-is( $res, 1, $t);
+is ($@, q{}, $t);
+is ($res, 1, $t);
$t=q{Method do() works as expected with an unused attribute and a non-prepared param };
eval {
$res = $dbh->do('SET random_page_cost TO ?', undef, '2.2');
};
-is( $@, q{}, $t);
-is( $res, '0E0', $t);
+is ($@, q{}, $t);
+is ($res, '0E0', $t);
$t=q{Method do() works as expected with an unused attribute and multiple real bind params };
eval {
$res = $dbh->do('SELECT count(*) FROM pg_class WHERE reltuples IN (?,?,?)', undef, 1,2,3);
};
-is( $@, q{}, $t);
-is( $res, 1, $t);
+is ($@, q{}, $t);
+is ($res, 1, $t);
$t=q{Cancelling a non-async do() query gives an error };
eval {
$res = $dbh->pg_cancel();
};
-like( $@, qr{No asynchronous query is running}, $t);
+like ($@, qr{No asynchronous query is running}, $t);
$t=q{Method do() works as expected with an asychronous flag };
eval {
$res = $dbh->do('SELECT 123', {pg_async => PG_ASYNC});
};
-is( $@, q{}, $t);
-is( $res, '0E0', $t);
+is ($@, q{}, $t);
+is ($res, '0E0', $t);
$t=q{Database attribute "async_status" returns 1 after async query};
$res = $dbh->{pg_async_status};
-is( $res, +1, $t);
+is ($res, +1, $t);
$t=q{Cancelling an async do() query works };
eval {
$res = $dbh->pg_cancel();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database method pg_cancel returns a false value when cancellation works but finished};
-is( $res, q{}, $t);
+is ($res, q{}, $t);
$t=q{Database attribute "async_status" returns -1 after pg_cancel};
$res = $dbh->{pg_async_status};
-is( $res, -1, $t);
+is ($res, -1, $t);
$t=q{Running do() after a cancelled query works};
eval {
$res = $dbh->do('SELECT 123');
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database attribute "async_status" returns 0 after normal query run};
$res = $dbh->{pg_async_status};
-is( $res, 0, $t);
+is ($res, 0, $t);
$t=q{Method pg_ready() fails after a non-async query};
eval {
$dbh->pg_ready();
};
-like( $@, qr{No async}, $t);
+like ($@, qr{No async}, $t);
$res = $dbh->do('SELECT 123', {pg_async => PG_ASYNC});
$t=q{Method pg_ready() works after a non-async query};
@@ -117,30 +117,30 @@
eval {
$res = $dbh->pg_ready();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database method pg_ready() returns 1 after a completed async do()};
-is( $res, 1, $t);
+is ($res, 1, $t);
$res = $dbh->pg_ready();
$t=q{Database method pg_ready() returns true when called a second time};
-is( $res, 1, $t);
+is ($res, 1, $t);
$t=q{Database method pg_ready() returns 1 after a completed async do()};
-is( $res, 1, $t);
+is ($res, 1, $t);
$t=q{Cancelling an async do() query works };
eval {
$res = $dbh->pg_cancel();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database method pg_cancel() returns expected false value for completed value};
-is( $res, q{}, $t);
+is ($res, q{}, $t);
$t=q{Method do() runs after pg_cancel has cleared the async query};
eval {
$dbh->do('SELECT 456');
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$dbh->do(q{SELECT 'async2'}, {pg_async => PG_ASYNC});
@@ -148,51 +148,51 @@
eval {
$dbh->do(q{SELECT 'async_blocks'});
};
-like( $@, qr{previous async}, $t);
+like ($@, qr{previous async}, $t);
$t=q{Database method pg_result works as expected};
eval {
$res = $dbh->pg_result();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database method pg_result() returns correct value};
-is( $res, 1, $t);
+is ($res, 1, $t);
$t=q{Database method pg_result() fails when called twice};
eval {
$dbh->pg_result();
};
-like( $@, qr{No async}, $t);
+like ($@, qr{No async}, $t);
$t=q{Database method pg_cancel() fails when called after pg_result()};
eval {
$dbh->pg_cancel();
};
-like( $@, qr{No async}, $t);
+like ($@, qr{No async}, $t);
$t=q{Database method pg_ready() fails when called after pg_result()};
eval {
$dbh->pg_ready();
};
-like( $@, qr{No async}, $t);
+like ($@, qr{No async}, $t);
$t=q{Database method do() works after pg_result()};
eval {
$dbh->do('SELECT 123');
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
SKIP: {
if ($pgversion < 80200) {
- skip 'Need pg_sleep() to perform rest of async tests: your Postgres is too old', 14;
+ skip ('Need pg_sleep() to perform rest of async tests: your Postgres is too old', 14);
}
eval {
$dbh->do('SELECT pg_sleep(0)');
};
- is( $@, q{}, 'Calling pg_sleep works as expected');
+ is ($@, q{}, 'Calling pg_sleep works as expected');
my $time = time();
eval {
@@ -200,49 +200,49 @@
};
$time = time()-$time;
$t = q{Database method do() returns right away when in async mode};
- cmp_ok( $time, '<=', 1, $t);
+ cmp_ok ($time, '<=', 1, $t);
$t=q{Method pg_ready() returns false when query is still running};
$res = $dbh->pg_ready();
- is( $res, 0, $t);
+ is ($res, 0, $t);
- pass( 'Sleeping to allow query to finish');
+ pass ('Sleeping to allow query to finish');
sleep(3);
$t=q{Method pg_ready() returns true when query is finished};
$res = $dbh->pg_ready();
- ok( $res, $t);
+ ok ($res, $t);
$t=q{Method do() will not work if async query not yet cleared};
eval {
$dbh->do('SELECT pg_sleep(2)', {pg_async => PG_ASYNC});
};
- like( $@, qr{previous async}, $t);
+ like ($@, qr{previous async}, $t);
$t=q{Database method pg_cancel() works while async query is running};
eval {
$res = $dbh->pg_cancel();
};
- is( $@, q{}, $t);
+ is ($@, q{}, $t);
$t=q{Database method pg_cancel returns false when query has already finished};
- ok( !$res, $t);
+ ok (!$res, $t);
$t=q{Database method pg_result() fails after async query has been cancelled};
eval {
$res = $dbh->pg_result();
};
- like( $@, qr{No async}, $t);
+ like ($@, qr{No async}, $t);
$t=q{Database method do() cancels the previous async when requested};
eval {
$res = $dbh->do('SELECT pg_sleep(2)', {pg_async => PG_ASYNC + PG_OLDQUERY_CANCEL});
};
- is( $@, q{}, $t);
+ is ($@, q{}, $t);
$t=q{Database method pg_result works when async query is still running};
eval {
$res = $dbh->pg_result();
};
- is( $@, q{}, $t);
+ is ($@, q{}, $t);
## Now throw in some execute after the do()
$sth = $dbh->prepare('SELECT 567');
@@ -252,14 +252,14 @@
eval {
$res = $sth->execute();
};
- like( $@, qr{previous async}, $t);
+ like ($@, qr{previous async}, $t);
$t = q{Running execute after async do() works when told to cancel};
$sth = $dbh->prepare('SELECT 678', {pg_async => PG_OLDQUERY_CANCEL});
eval {
$sth->execute();
};
- is( $@, q{}, $t);
+ is ($@, q{}, $t);
$t = q{Running execute after async do() works when told to wait};
$dbh->do('SELECT pg_sleep(2)', {pg_async => PG_ASYNC});
@@ -267,7 +267,7 @@
eval {
$sth->execute();
};
- is( $@, q{}, $t);
+ is ($@, q{}, $t);
$sth->finish();
@@ -279,33 +279,33 @@
eval {
$sth->execute();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database attribute "async_status" returns 1 after prepare async};
$res = $dbh->{pg_async_status};
-is( $res, 1, $t);
+is ($res, 1, $t);
$t=q{Method do() fails when previous async prepare has been executed};
eval {
$dbh->do('SELECT 123');
};
-like( $@, qr{previous async}, $t);
+like ($@, qr{previous async}, $t);
$t=q{Method execute() fails when previous async prepare has been executed};
eval {
$sth->execute();
};
-like( $@, qr{previous async}, $t);
+like ($@, qr{previous async}, $t);
$t=q{Database method pg_cancel works if async query has already finished};
sleep 0.5;
eval {
$res = $sth->pg_cancel();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Statement method pg_cancel() returns a false value when cancellation works but finished};
-is( $res, q{}, $t);
+is ($res, q{}, $t);
$t=q{Method do() fails when previous execute async has not been cleared};
$sth->execute();
@@ -313,36 +313,36 @@
eval {
$dbh->do('SELECT 345');
};
-like( $@, qr{previous async}, $t);
+like ($@, qr{previous async}, $t);
$dbh->pg_cancel;
$t=q{Directly after pg_cancel(), pg_async_status is -1};
-is( $dbh->{pg_async_status}, -1, $t);
+is ($dbh->{pg_async_status}, -1, $t);
$t=q{Method execute() works when prepare has PG_ASYNC flag};
$sth->execute();
$t=q{After async execute, pg_async_status is 1};
-is( $dbh->{pg_async_status}, 1, $t);
+is ($dbh->{pg_async_status}, 1, $t);
$t=q{Method pg_result works after a prepare/execute call};
eval {
$res = $dbh->pg_result;
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Method pg_result() returns expected result after prepare/execute select};
-is( $res, 1, $t);
+is ($res, 1, $t);
$t=q{Method fetchall_arrayref works after pg_result};
eval {
$res = $sth->fetchall_arrayref();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Method fetchall_arrayref returns correct result after pg_result};
-is_deeply( $res, [[123]], $t);
+is_deeply ($res, [[123]], $t);
$dbh->do('CREATE TABLE dbd_pg_test5(id INT, t TEXT)');
$dbh->commit();
@@ -355,28 +355,28 @@
eval {
$sth2 = $dbh->prepare($SQL, {pg_async => PG_ASYNC + PG_OLDQUERY_CANCEL});
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Fetch on cancelled statement handle fails};
eval {
$sth->fetch();
};
-like( $@, qr{no statement executing}, $t);
+like ($@, qr{no statement executing}, $t);
$t=q{Method execute works after async + cancel prepare};
eval {
$sth2->execute();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Statement method pg_result works on async statement handle};
eval {
$res = $sth2->pg_result();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Statement method pg_result returns correct result after execute};
-is( $res, 2, $t);
+is ($res, 2, $t);
$sth2->execute();
@@ -384,9 +384,9 @@
eval {
$res = $sth2->pg_result();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Database method pg_result returns correct result after execute};
-is( $res, 2, $t);
+is ($res, 2, $t);
$dbh->do('DROP TABLE dbd_pg_test5');
Modified: DBD-Pg/trunk/t/09arrays.t
==============================================================================
--- DBD-Pg/trunk/t/09arrays.t (original)
+++ DBD-Pg/trunk/t/09arrays.t Sun Jul 6 18:37:54 2008
@@ -19,9 +19,9 @@
}
plan tests => 245;
-isnt( $dbh, undef, 'Connect to database for array testing');
+isnt ($dbh, undef, 'Connect to database for array testing');
-my ($sth,$result);
+my ($sth,$result,$t);
my $pgversion = $dbh->{pg_server_version};
@@ -29,8 +29,6 @@
$dbh->do('SET escape_string_warning = false');
}
-
-
my $SQL = q{DELETE FROM dbd_pg_test WHERE pname = 'Array Testing'};
my $cleararray = $dbh->prepare($SQL);
@@ -191,39 +189,43 @@
my $ver = $1;
if ($pgversion < $ver) {
SKIP: {
- skip 'Cannot test NULL arrays unless version 8.2 or better', 4;
+ skip ('Cannot test NULL arrays unless version 8.2 or better', 4);
}
next;
}
}
+ $t="Correct array inserted: $msg : $input";
$cleararray->execute();
eval {
$addarray->execute(eval $input);
};
if ($expected =~ /error:\s+(.+)/i) {
- like( $@, qr{$1}, "Array failed : $msg : $input");
- like( $@, qr{$1}, "Array failed : $msg : $input");
+ like ($@, qr{$1}, "Array failed : $msg : $input");
+ like ($@, qr{$1}, "Array failed : $msg : $input");
}
else {
- is( $@, q{}, "Array worked : $msg : $input");
+ is ($@, q{}, "Array worked : $msg : $input");
$getarray->execute();
$result = $getarray->fetchall_arrayref()->[0][0];
- is( $result, $expected, "Correct array inserted: $msg : $input");
+ is ($result, $expected, $t);
}
+ $t="Array quote worked : $msg : $input";
eval {
$result = $dbh->quote(eval $input );
};
if ($qexpected =~ /error:\s+(.+)/i) {
my $errmsg = $1;
$errmsg =~ s/bind/quote/;
- like( $@, qr{$errmsg}, "Array quote failed : $msg : $input");
- like( $@, qr{$errmsg}, "Array quote failed : $msg : $input");
+ like ($@, qr{$errmsg}, "Array quote failed : $msg : $input");
+ like ($@, qr{$errmsg}, "Array quote failed : $msg : $input");
}
else {
- is( $@, q{}, "Array quote worked : $msg : $input");
- is( $result, $qexpected, "Correct array quote: $msg : $input");
+ is ($@, q{}, $t);
+
+ $t="Correct array quote: $msg : $input";
+ is ($result, $qexpected, $t);
}
}
@@ -244,22 +246,25 @@
my $ver = $1;
if ($pgversion < $ver) {
SKIP: {
- skip 'Cannot test NULL arrays unless version 8.2 or better', 2;
+ skip ('Cannot test NULL arrays unless version 8.2 or better', 2);
}
next;
}
}
+ $t="Array worked : $msg : $input";
$cleararray->execute();
eval {
$addarray->execute(eval $input);
};
if ($expected =~ /error:\s+(.+)/i) {
- like( $@, qr{$1}, "Array failed : $msg : $input");
- like( $@, qr{$1}, "Array failed : $msg : $input");
+ like ($@, qr{$1}, "Array failed : $msg : $input");
+ like ($@, qr{$1}, "Array failed : $msg : $input");
}
else {
- is( $@, q{}, "Array worked : $msg : $input");
+ is ($@, q{}, $t);
+
+ $t="Correct array inserted: $msg : $input";
$getarray->execute();
$result = $getarray->fetchall_arrayref()->[0][0];
$qexpected =~ s/{}/{''}/;
@@ -272,7 +277,7 @@
$qexpected =~ s/]"/}"/;
}
$expected = eval $qexpected;
- is_deeply( $result, $expected, "Correct array inserted: $msg : $input");
+ is_deeply ($result, $expected, $t);
}
if ($msg =~ /STOP/) {
@@ -433,7 +438,7 @@
my $ver = $1;
if ($pgversion < $ver) {
SKIP: {
- skip 'Cannot test NULL arrays unless version 8.2 or better', 1;
+ skip ('Cannot test NULL arrays unless version 8.2 or better', 1);
}
next;
}
@@ -441,24 +446,25 @@
if ($pgversion < 80200) {
if ($input =~ /SKIP/ or $test =~ /Fake NULL|boolean/) {
SKIP: {
- skip 'Cannot test some array items on pre-8.2 servers', 1;
+ skip ('Cannot test some array items on pre-8.2 servers', 1);
}
next;
}
}
+ $t="Array test $msg : $input";
$SQL = qq{SELECT ARRAY[$input]};
my $result = '';
eval {
$result = $dbh->selectall_arrayref($SQL)->[0][0];
};
if ($result =~ /error:\s+(.+)/i) {
- like( $@, qr{$1}, "Array failed : $msg : $input");
+ like ($@, qr{$1}, "Array failed : $msg : $input");
}
else {
$expected = eval $expected;
## is_deeply does not handle type differences
- is( (Dumper $result), (Dumper $expected), "Array test $msg : $input");
+ is ( (Dumper $result), (Dumper $expected), $t);
}
}
@@ -466,18 +472,26 @@
SKIP: {
eval { require Encode; };
- skip 'Encode module is needed for unicode tests', 14 if $@;
+ skip ('Encode module is needed for unicode tests', 14) if $@;
+ $t='String should be UTF-8';
local $dbh->{pg_enable_utf8} = 1;
my $utf8_str = chr(0x100).'dam'; # LATIN CAPITAL LETTER A WITH MACRON
- ok( Encode::is_utf8( $utf8_str ), 'String should be UTF-8');
+ ok (Encode::is_utf8( $utf8_str ), $t);
+ $t='quote() handles utf8';
my $quoted = $dbh->quote($utf8_str);
- is( $quoted, qq{'$utf8_str'}, 'quote() handles utf8' );
- ok( Encode::is_utf8( $quoted ), 'Quoted string should be UTF-8');
+ is ($quoted, qq{'$utf8_str'}, $t);
+
+ $t='Quoted string should be UTF-8';
+ ok (Encode::is_utf8( $quoted ), $t);
+
+ $t='quote() handles utf8 inside array';
$quoted = $dbh->quote([$utf8_str, $utf8_str]);
- is( $quoted, qq!{"$utf8_str","$utf8_str"}!, 'quote() handles utf8 inside array' );
- ok( Encode::is_utf8( $quoted ), 'Quoted array of strings should be UTF-8');
+ is ($quoted, qq!{"$utf8_str","$utf8_str"}!, $t);
+
+ $t='Quoted array of strings should be UTF-8';
+ ok (Encode::is_utf8( $quoted ), $t);
## Workaround for client encodings such as SJIS
my $old_encoding = $dbh->selectall_arrayref('SHOW client_encoding')->[0][0];
@@ -485,41 +499,52 @@
$dbh->do(q{SET NAMES 'UTF8'});
}
+ $t='Inserting utf-8 into an array via quoted do() works';
$dbh->do('DELETE FROM dbd_pg_test');
$SQL = qq{INSERT INTO dbd_pg_test (id, testarray, val) VALUES (1, '$quoted', 'one')};
eval {
$dbh->do($SQL);
};
- is( $@, q{}, 'Inserting utf-8 into an array via quoted do() works');
+ is ($@, q{}, $t);
+ $t='Retreiving an array containing utf-8 works';
$SQL = q{SELECT id, testarray, val FROM dbd_pg_test WHERE id = 1};
$sth = $dbh->prepare($SQL);
$sth->execute();
$result = $sth->fetchall_arrayref()->[0];
- my $t = q{Retreiving an array containing utf-8 works};
my $expected = [1,[$utf8_str,$utf8_str],'one'];
- is_deeply( $result, $expected, $t);
- ok( Encode::is_utf8( $result->[1][0] ), 'Selected string should be UTF-8');
- ok( Encode::is_utf8( $result->[1][1] ), 'Selected string should be UTF-8');
+ is_deeply ($result, $expected, $t);
+
+ $t='Selected string should be UTF-8';
+ ok (Encode::is_utf8( $result->[1][0] ), $t);
+
+ $t='Selected string should be UTF-8';
+ ok (Encode::is_utf8( $result->[1][1] ), $t);
+ $t='Inserting utf-8 into an array via prepare and arrayref works';
$dbh->do('DELETE FROM dbd_pg_test');
$SQL = q{INSERT INTO dbd_pg_test (id, testarray, val) VALUES (?, ?, 'one')};
$sth = $dbh->prepare($SQL);
eval {
$sth->execute(1,['Bob',$utf8_str]);
};
- is( $@, q{}, 'Inserting utf-8 into an array via prepare and arrayref works');
+ is ($@, q{}, $t);
+ $t='Retreiving an array containing utf-8 works';
$SQL = q{SELECT id, testarray, val FROM dbd_pg_test WHERE id = 1};
$sth = $dbh->prepare($SQL);
$sth->execute();
$result = $sth->fetchall_arrayref()->[0];
- $t = q{Retreiving an array containing utf-8 works};
$expected = [1,['Bob',$utf8_str],'one'];
- is_deeply( $result, $expected, $t);
- ok( !Encode::is_utf8( $result->[1][0] ), 'Selected ASCII string should not be UTF-8');
- ok( Encode::is_utf8( $result->[1][1] ), 'Selected string should be UTF-8');
+ is_deeply ($result, $expected, $t);
+
+ $t='Selected ASCII string should not be UTF-8';
+ ok (!Encode::is_utf8( $result->[1][0] ), $t);
+
+ $t='Selected string should be UTF-8';
+ ok (Encode::is_utf8( $result->[1][1] ), $t);
+ $t='Non utf-8 inside an array is not return as utf-8';
$dbh->do('DELETE FROM dbd_pg_test');
$SQL = q{INSERT INTO dbd_pg_test (id, testarray, val) VALUES (1, '{"noutfhere"}', 'one')};
$dbh->do($SQL);
@@ -527,7 +552,7 @@
$sth = $dbh->prepare($SQL);
$sth->execute();
$result = $sth->fetchall_arrayref()->[0][0];
- ok( !Encode::is_utf8($result), 'Non utf-8 inside an array is not return as utf-8');
+ ok (!Encode::is_utf8($result), $t);
$sth->finish();
}
Modified: DBD-Pg/trunk/t/12placeholders.t
==============================================================================
--- DBD-Pg/trunk/t/12placeholders.t (original)
+++ DBD-Pg/trunk/t/12placeholders.t Sun Jul 6 18:37:54 2008
@@ -16,8 +16,8 @@
}
plan tests => 27;
-my $t=q{Connect to database for placeholder testing};
-isnt( $dbh, undef, $t);
+my $t='Connect to database for placeholder testing';
+isnt ($dbh, undef, $t);
my ($pglibversion,$pgversion) = ($dbh->{pg_lib_version},$dbh->{pg_server_version});
if ($pgversion >= 80100) {
@@ -25,18 +25,18 @@
}
# Make sure that quoting works properly.
+$t='Quoting works properly';
my $E = $pgversion >= 80100 ? q{E} : q{};
-$t=q{Quoting works properly};
my $quo = $dbh->quote('\\\'?:');
-is( $quo, qq{${E}'\\\\''?:'}, $t);
+is ($quo, qq{${E}'\\\\''?:'}, $t);
-$t=q{Quoting works with a function call};
+$t='Quoting works with a function call';
# Make sure that quoting works with a function call.
# It has to be in this function, otherwise it doesn't fail the
# way described in https://rt.cpan.org/Ticket/Display.html?id=4996.
sub checkquote {
my $str = shift;
- return is( $dbh->quote(substr($str, 0, 10)), "'$str'", $t);
+ return is ($dbh->quote(substr($str, 0, 10)), "'$str'", $t);
}
checkquote('one');
@@ -44,84 +44,76 @@
checkquote('three');
checkquote('four');
+$t='Fetch returns the correct quoted value';
my $sth = $dbh->prepare(qq{INSERT INTO dbd_pg_test (id,pname) VALUES (?, $quo)});
$sth->execute(100);
-
my $sql = "SELECT pname FROM dbd_pg_test WHERE pname = $quo";
$sth = $dbh->prepare($sql);
$sth->execute();
-
-$t=q{Fetch returns the correct quoted value};
my ($retr) = $sth->fetchrow_array();
-is( $retr, '\\\'?:', $t);
+is ($retr, '\\\'?:', $t);
-$t=q{Execute with one bind param where none expected fails};
+$t='Execute with one bind param where none expected fails';
eval {
$sth = $dbh->prepare($sql);
$sth->execute('foo');
};
-like( $@, qr{when 0 are needed}, $t);
+like ($@, qr{when 0 are needed}, $t);
+$t='Execute with ? placeholder works';
$sql = 'SELECT pname FROM dbd_pg_test WHERE pname = ?';
$sth = $dbh->prepare($sql);
$sth->execute('\\\'?:');
-
-$t=q{Execute with ? placeholder works};
($retr) = $sth->fetchrow_array();
-is( $retr, '\\\'?:', $t);
+is ($retr, '\\\'?:', $t);
+$t='Execute with :1 placeholder works';
$sql = 'SELECT pname FROM dbd_pg_test WHERE pname = :1';
$sth = $dbh->prepare($sql);
$sth->bind_param(':1', '\\\'?:');
$sth->execute();
-
-$t=q{Execute with :1 placeholder works};
($retr) = $sth->fetchrow_array();
-is( $retr, '\\\'?:', $t);
+is ($retr, '\\\'?:', $t);
+$t='Execute with $1 placeholder works';
$sql = q{SELECT pname FROM dbd_pg_test WHERE pname = $1 AND pname <> 'foo'};
$sth = $dbh->prepare($sql);
$sth->execute('\\\'?:');
-
-$t=q{Execute with $1 placeholder works};
($retr) = $sth->fetchrow_array();
-is( $retr, '\\\'?:', $t);
+is ($retr, '\\\'?:', $t);
+$t='Execute with quoted ? fails with a placeholder';
$sql = q{SELECT pname FROM dbd_pg_test WHERE pname = '?'};
-
-$t=q{Execute with quoted ? fails with a placeholder};
eval {
$sth = $dbh->prepare($sql);
$sth->execute('foo');
};
-like( $@, qr{when 0 are needed}, $t);
+like ($@, qr{when 0 are needed}, $t);
+$t='Execute with quoted :1 fails with a placeholder';
$sql = q{SELECT pname FROM dbd_pg_test WHERE pname = ':1'};
-
-$t=q{Execute with quoted :1 fails with a placeholder};
eval {
$sth = $dbh->prepare($sql);
$sth->execute('foo');
};
-like( $@, qr{when 0 are needed}, $t);
+like ($@, qr{when 0 are needed}, $t);
+$t='Execute with quoted ? fails with a placeholder';
$sql = q{SELECT pname FROM dbd_pg_test WHERE pname = '\\\\' AND pname = '?'};
-
-$t=q{Execute with quoted ? fails with a placeholder};
eval {
$sth = $dbh->prepare($sql);
$sth->execute('foo');
};
-like( $@, qr{when 0 are needed}, $t);
+like ($@, qr{when 0 are needed}, $t);
-$t=q{Prepare with large number of parameters works};
+$t='Prepare with large number of parameters works';
## Test large number of placeholders
$sql = 'SELECT 1 FROM dbd_pg_test WHERE id IN (' . '?,' x 300 . '?)';
my @args = map { $_ } (1..301);
$sth = $dbh->prepare($sql);
my $count = $sth->execute(@args);
$sth->finish();
-is( $count, 1, $t);
+is ($count, 1, $t);
$sth->finish();
@@ -131,11 +123,10 @@
$dbh->do(q{SET NAMES 'UTF8'});
}
+$t='Prepare with backslashes inside quotes works';
my $SQL = q{SELECT setting FROM pg_settings WHERE name = 'backslash_quote'};
$count = $dbh->selectall_arrayref($SQL)->[0];
my $backslash = defined $count ? $count->[0] : 0;
-
-$t=q{Prepare with backslashes inside quotes works};
my $scs = $dbh->{pg_standard_conforming_strings};
$SQL = $scs ? q{SELECT E'\\'?'} : q{SELECT '\\'?'};
$sth = $dbh->prepare($SQL);
@@ -143,61 +134,60 @@
$sth->execute();
};
my $expected = $backslash eq 'off' ? qr{unsafe} : qr{};
-like( $@, $expected, $t);
+like ($@, $expected, $t);
+
+$t='Calling do() with non-DML placeholder works';
$sth->finish();
$dbh->commit();
-
-$t=q{Calling do() with non-DML placeholder works};
eval {
$dbh->do(q{SET search_path TO ?}, undef, 'public');
};
-is( $@, q{}, $t);
-$dbh->commit();
+is ($@, q{}, $t);
-$t=q{Calling do() with DML placeholder works};
+$t='Calling do() with DML placeholder works';
+$dbh->commit();
eval {
$dbh->do(q{SELECT ?::text}, undef, 'public');
};
-is( $@, q{}, $t);
-$dbh->commit();
+is ($@, q{}, $t);
-$t=q{Prepare/execute with non-DML placehlder works};
+$t='Prepare/execute with non-DML placeholder works';
+$dbh->commit();
eval {
$sth = $dbh->prepare(q{SET search_path TO ?});
$sth->execute('public');
};
-is( $@, q{}, $t);
-$dbh->commit();
+is ($@, q{}, $t);
-$t=q{Prepare/execute does not allow geometric operators};
+$t='Prepare/execute does not allow geometric operators';
+$dbh->commit();
eval {
$sth = $dbh->prepare(q{SELECT ?- lseg '(1,0),(1,1)'});
$sth->execute();
};
-like( $@, qr{unbound placeholder}, $t);
-$dbh->commit();
+like ($@, qr{unbound placeholder}, $t);
-$t=q{Prepare/execute allows geometric operator ?- when dollaronly is set};
+$t='Prepare/execute allows geometric operator ?- when dollaronly is set';
+$dbh->commit();
$dbh->{pg_placeholder_dollaronly} = 1;
eval {
$sth = $dbh->prepare(q{SELECT ?- lseg '(1,0),(1,1)'});
$sth->execute();
$sth->finish();
};
-is( $@, q{}, $t);
-$dbh->commit();
+is ($@, q{}, $t);
-
-$t=q{Prepare/execute allows geometric operator ?# when dollaronly set};
+$t='Prepare/execute allows geometric operator ?# when dollaronly set';
+$dbh->commit();
eval {
$sth = $dbh->prepare(q{SELECT lseg'(1,0),(1,1)' ?# lseg '(2,3),(4,5)'});
$sth->execute();
$sth->finish();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
$t=q{Value of placeholder_dollaronly can be retrieved};
-is( $dbh->{pg_placeholder_dollaronly}, 1, $t);
+is ($dbh->{pg_placeholder_dollaronly}, 1, $t);
$t=q{Prepare/execute does not allow use of raw ? and :foo forms};
$dbh->{pg_placeholder_dollaronly} = 0;
@@ -206,9 +196,9 @@
$sth->execute();
$sth->finish();
};
-like( $@, qr{mix placeholder}, $t);
+like ($@, qr{mix placeholder}, $t);
-$t=q{Prepare/execute allows use of raw ? and :foo forms when dollaronly set};
+$t='Prepare/execute allows use of raw ? and :foo forms when dollaronly set';
$dbh->{pg_placeholder_dollaronly} = 1;
eval {
$sth = $dbh->prepare(q{SELECT uno ?: dos ? tres :foo bar $1}, {pg_placeholder_dollaronly => 1});
@@ -216,23 +206,23 @@
$sth->execute();
$sth->finish();
};
-like( $@, qr{unbound placeholder}, $t);
+like ($@, qr{unbound placeholder}, $t);
-$t=q{Prepare works with pg_placeholder_dollaronly};
+$t='Prepare works with pg_placeholder_dollaronly';
$dbh->{pg_placeholder_dollaronly} = 0;
eval {
$sth = $dbh->prepare(q{SELECT uno ?: dos ? tres :foo bar $1}, {pg_placeholder_dollaronly => 1});
$sth->execute();
$sth->finish();
};
-like( $@, qr{unbound placeholder}, $t);
+like ($@, qr{unbound placeholder}, $t);
-$t=q{Prepare works with identical named placeholders};
+$t='Prepare works with identical named placeholders';
eval {
$sth = $dbh->prepare(q{SELECT :row, :row, :row, :yourboat});
$sth->finish();
};
-is( $@, q{}, $t);
+is ($@, q{}, $t);
## Begin custom type testing
Modified: DBD-Pg/trunk/t/20savepoints.t
==============================================================================
--- DBD-Pg/trunk/t/20savepoints.t (original)
+++ DBD-Pg/trunk/t/20savepoints.t Sun Jul 6 18:37:54 2008
@@ -17,12 +17,14 @@
}
plan tests => 3;
-isnt( $dbh, undef, 'Connect to database for savepoint testing');
+isnt ($dbh, undef, 'Connect to database for savepoint testing');
my $pgversion = $dbh->{pg_server_version};
+my $t;
+
SKIP: {
- skip 'Cannot test savepoints on pre-8.0 servers', 2 if $pgversion < 80000;
+ skip ('Cannot test savepoints on pre-8.0 servers', 2) if $pgversion < 80000;
my $str = 'Savepoint Test';
my $sth = $dbh->prepare('INSERT INTO dbd_pg_test (id,pname) VALUES (?,?)');
@@ -42,8 +44,9 @@
$dbh->commit;
+ $t='Only row 500 and 502 should be committed';
my $ids = $dbh->selectcol_arrayref('SELECT id FROM dbd_pg_test WHERE pname = ?',undef,$str);
- ok( eq_set($ids, [500, 502]), 'Only row 500 and 502 should be committed');
+ ok (eq_set($ids, [500, 502]), $t);
## Create 503, then release the savepoint
$dbh->pg_savepoint('dbd_pg_test_savepoint');
@@ -54,8 +57,9 @@
$sth->execute(504,$str);
$dbh->commit;
+ $t='Implicit rollback on deallocate should rollback to last savepoint';
$ids = $dbh->selectcol_arrayref('SELECT id FROM dbd_pg_test WHERE pname = ?',undef,$str);
- ok( eq_set($ids, [500, 502, 503, 504]), 'Implicit rollback on deallocate should rollback to last savepoint');
+ ok (eq_set($ids, [500, 502, 503, 504]), $t);
}
$dbh->do('DELETE FROM dbd_pg_test');
Modified: DBD-Pg/trunk/t/99_pod.t
==============================================================================
--- DBD-Pg/trunk/t/99_pod.t (original)
+++ DBD-Pg/trunk/t/99_pod.t Sun Jul 6 18:37:54 2008
@@ -18,10 +18,10 @@
SKIP: {
if ($@ or $Test::Pod::VERSION < $PODVERSION) {
- skip "Test::Pod $PODVERSION is required", 2;
+ skip ("Test::Pod $PODVERSION is required", 2);
}
- pod_file_ok('Pg.pm');
- pod_file_ok('lib/Bundle/DBD/Pg.pm');
+ pod_file_ok ('Pg.pm');
+ pod_file_ok ('lib/Bundle/DBD/Pg.pm');
}
## We won't require everyone to have this, so silently move on if not found
@@ -33,7 +33,7 @@
SKIP: {
if ($@ or $Test::Pod::Coverage::VERSION < $PODCOVERVERSION) {
- skip "Test::Pod::Coverage $PODCOVERVERSION is required", 1;
+ skip ("Test::Pod::Coverage $PODCOVERVERSION is required", 1);
}
my $trusted_names =
@@ -177,5 +177,7 @@
qr{PG_XMLARRAY},
];
- pod_coverage_ok('DBD::Pg', {trustme => $trusted_names}, 'DBD::Pg pod coverage okay');
+
+ my $t='DBD::Pg pod coverage okay';
+ pod_coverage_ok ('DBD::Pg', {trustme => $trusted_names}, $t);
}
Modified: DBD-Pg/trunk/t/99_spellcheck.t
==============================================================================
--- DBD-Pg/trunk/t/99_spellcheck.t (original)
+++ DBD-Pg/trunk/t/99_spellcheck.t Sun Jul 6 18:37:54 2008
@@ -47,7 +47,7 @@
}
my $count = keys %badword;
if (! $count) {
- pass("Spell check passed for $desc");
+ pass ("Spell check passed for $desc");
return;
}
fail ("Spell check failed for $desc. Bad words: $count");
@@ -61,7 +61,7 @@
## First, the plain ol' textfiles
for my $file (qw/README Changes TODO README.dev README.win32/) {
if (!open $fh, '<', $file) {
- fail(qq{Could not find the file "$file"!});
+ fail (qq{Could not find the file "$file"!});
}
else {
{ local $/; $_ = <$fh>; }
@@ -77,29 +77,29 @@
elsif ($file eq 'README.dev') {
s/^\t\$.+//gsm;
}
- spellcheck($file => $_, $file);
+ spellcheck ($file => $_, $file);
}
}
## Now the embedded POD
SKIP: {
if (!eval { require Pod::Spell; 1 }) {
- skip 'Need Pod::Spell to test the spelling of embedded POD', 2;
+ skip ('Need Pod::Spell to test the spelling of embedded POD', 2);
}
for my $file (qw{Pg.pm lib/Bundle/DBD/Pg.pm}) {
if (! -e $file) {
- fail(qq{Could not find the file "$file"!});
+ fail (qq{Could not find the file "$file"!});
}
my $string = qx{podspell $file};
- spellcheck("POD from $file" => $string, $file);
+ spellcheck ("POD from $file" => $string, $file);
}
}
## Now the comments
SKIP: {
if (!eval { require File::Comments; 1 }) {
- skip 'Need File::Comments to test the spelling inside comments', 2;
+ skip ('Need File::Comments to test the spelling inside comments', 2);
}
{
## For XS files...
@@ -130,16 +130,16 @@
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"!});
+ fail (qq{Could not find the file "$file"!});
}
my $string = $fc->comments($file);
if (! $string) {
- fail(qq{Could not get comments from file $file});
+ fail (qq{Could not get comments from file $file});
next;
}
$string = join "\n" => @$string;
$string =~ s/=head1.+//sm;
- spellcheck("comments from $file" => $string, $file);
+ spellcheck ("comments from $file" => $string, $file);
}
Modified: DBD-Pg/trunk/t/99_yaml.t
==============================================================================
--- DBD-Pg/trunk/t/99_yaml.t (original)
+++ DBD-Pg/trunk/t/99_yaml.t Sun Jul 6 18:37:54 2008
@@ -16,14 +16,14 @@
};
if ($@) {
SKIP: {
- skip 'Skipping Test::YAML::Meta tests: module not found', 2;
+ skip ('Skipping Test::YAML::Meta tests: module not found', 2);
}
}
elsif ($Test::YAML::Meta::VERSION < $V) {
SKIP: {
- skip "Skipping Test::YAML::Meta tests: need version $V, but only have $Test::YAML::Meta::VERSION", 2;
+ skip ("Skipping Test::YAML::Meta tests: need version $V, but only have $Test::YAML::Meta::VERSION", 2);
}
}
else {
- meta_spec_ok('META.yml', 1.3);
+ meta_spec_ok ('META.yml', 1.3);
}
Modified: DBD-Pg/trunk/t/99cleanup.t
==============================================================================
--- DBD-Pg/trunk/t/99cleanup.t (original)
+++ DBD-Pg/trunk/t/99cleanup.t Sun Jul 6 18:37:54 2008
@@ -14,10 +14,10 @@
SKIP: {
if (! defined $dbh) {
- skip 'Connection to database failed, cannot cleanup', 1;
+ skip ('Connection to database failed, cannot cleanup', 1);
}
- isnt( $dbh, undef, 'Connect to database for cleanup');
+ isnt ($dbh, undef, 'Connect to database for cleanup');
cleanup_database($dbh);
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.