Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Cvs P5ee > [svn:p5ee] r108...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 668 of 694
Post > Topic >>

[svn:p5ee] r10838 - p5ee/trunk/App-Repository/t

by spadkins@[EMAIL PROTECTED] Feb 26, 2008 at 09:31 AM

Author: spadkins
Date: Tue Feb 26 09:31:36 2008
New Revision: 10838

Modified:
   p5ee/trunk/App-Repository/t/DBI-metadata.t

Log:
added some metadata tests

Modified: p5ee/trunk/App-Repository/t/DBI-metadata.t
==============================================================================
--- p5ee/trunk/App-Repository/t/DBI-metadata.t	(original)
+++ p5ee/trunk/App-Repository/t/DBI-metadata.t	Tue Feb 26 09:31:36 2008
@[EMAIL PROTECTED]
 -77,6 +77,8 @[EMAIL PROTECTED]
     gender             char(1)      null,
     birth_dt           date         null,
     age                integer      null,
+    chess_rating       float        null,
+    modify_dttm        datetime     null,
     index person_ie1 (last_name, first_name)
 )
 EOF
@[EMAIL PROTECTED]
 -101,6 +103,25 @[EMAIL PROTECTED]
 is_deeply($db->{table}{test_person3}{primary_key}, ["person_id"],
"primary_key set from config (scalar)");
 is_deeply($db->{table}{test_person4}{primary_key}, ["person_id"],
"primary_key set from config (scalar)");
 
+my $tabledef = $db->get_table_def("test_person");
+is($tabledef->{column}{person_id}{type},    "integer",  "person_id type
is integer");
+is($tabledef->{column}{first_name}{type},   "string",   "first_name type
is integer");
+is($tabledef->{column}{country}{type},      "string",   "country type is
integer");
+is($tabledef->{column}{gender}{type},       "string",   "gender type is
integer");
+is($tabledef->{column}{birth_dt}{type},     "date",     "birth_dt type is
integer");
+is($tabledef->{column}{age}{type},          "integer",  "age type is
integer");
+is($tabledef->{column}{chess_rating}{type}, "float",    "chess_rating
type is integer");
+is($tabledef->{column}{modify_dttm}{type},  "datetime", "modify_dttm type
is integer");
+
+is($tabledef->{column}{person_id}{quoted},    0, "person_id quoted is
0");
+is($tabledef->{column}{first_name}{quoted},   1, "first_name quoted is
1");
+is($tabledef->{column}{country}{quoted},      1, "country quoted is 1");
+is($tabledef->{column}{gender}{quoted},       1, "gender quoted is 1");
+is($tabledef->{column}{birth_dt}{quoted},     1, "birth_dt quoted is 1");
+is($tabledef->{column}{age}{quoted},          0, "age quoted is 0");
+is($tabledef->{column}{chess_rating}{quoted}, 0, "chess_rating quoted is
0");
+is($tabledef->{column}{modify_dttm}{quoted},  1, "modify_dttm quoted is
1");
+
 #{
 #    eval { $db->{dbh}->do("drop table test_person"); };
 #}




 1 Posts in Topic:
[svn:p5ee] r10838 - p5ee/trunk/App-Repository/t
spadkins@[EMAIL PROTECTED  2008-02-26 09:31:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:24:15 CDT 2008.