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
@@ -77,6 +77,8 @@
     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
@@ -101,6 +103,25 @@
 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"); };
 #}

Reply via email to