[svn:DBD-Pg] r13943 - DBD-Pg/trunk/t

[email protected]
Newsgroups gmane.comp.db.postgresql.dbdpg.cvs
Message-ID <[email protected]>
Author: turnstep
Date: Wed May  5 08:01:42 2010
New Revision: 13943

Modified:
   DBD-Pg/trunk/t/03dbmethod.t

Log:
Fix some primary_key_info logic in tests; add specific PK_NAME and DATA_TYPE tests


Modified: DBD-Pg/trunk/t/03dbmethod.t
==============================================================================
--- DBD-Pg/trunk/t/03dbmethod.t	(original)
+++ DBD-Pg/trunk/t/03dbmethod.t	Wed May  5 08:01:42 2010
@@ -26,7 +26,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 529;
+plan tests => 531;
 
 isnt ($dbh, undef, 'Connect to database for database handle method testing');
 
@@ -610,11 +610,13 @@
 is_deeply (\%missing, {}, $t);
 
 ## Check some of the returned fields:
-$result = $result->[0];
-is ($r->{TABLE_CAT},   undef,         'DB handle method "primary_key_info" returns proper TABLE_CAT');
-is ($r->{TABLE_NAME},  'dbd_pg_test', 'DB handle method "primary_key_info" returns proper TABLE_NAME');
-is ($r->{COLUMN_NAME}, 'id',          'DB handle method "primary_key_info" returns proper COLUMN_NAME');
-cmp_ok ($result->{KEY_SEQ}, '>=', 1,  'DB handle method "primary_key_info" returns proper KEY_SEQ');
+$r = $result->[0];
+is ($r->{TABLE_CAT},   undef,              'DB handle method "primary_key_info" returns proper TABLE_CAT');
+is ($r->{TABLE_NAME},  'dbd_pg_test',      'DB handle method "primary_key_info" returns proper TABLE_NAME');
+is ($r->{COLUMN_NAME}, 'id',               'DB handle method "primary_key_info" returns proper COLUMN_NAME');
+is ($r->{PK_NAME},     'dbd_pg_test_pkey', 'DB handle method "primary_key_info" returns proper PK_NAME');
+is ($r->{DATA_TYPE},   'int4',             'DB handle method "primary_key_info" returns proper DATA_TYPE');
+is ($r->{KEY_SEQ},     1,                  'DB handle method "primary_key_info" returns proper KEY_SEQ');
 
 #
 # Test of the "primary_key" database handle method
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.