From: Rafael Kitover Date: Sat, 30 Jan 2010 23:42:11 +0000 (+0000) Subject: a couple more extra TODO tests for Sybase computed columns X-Git-Tag: 0.05000~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d1dc6de7c39309d9a4e8298ecaace25ac749ad6;p=dbsrgits%2FDBIx-Class-Schema-Loader.git a couple more extra TODO tests for Sybase computed columns --- diff --git a/t/15sybase_common.t b/t/15sybase_common.t index 623af02..903592f 100644 --- a/t/15sybase_common.t +++ b/t/15sybase_common.t @@ -2,6 +2,7 @@ use strict; use lib qw(t/lib); use dbixcsl_common_tests; use Test::More; +use Test::Exception; my $dsn = $ENV{DBICTEST_SYBASE_DSN} || ''; my $user = $ENV{DBICTEST_SYBASE_USER} || ''; @@ -25,7 +26,7 @@ my $tester = dbixcsl_common_tests->new( }, ], drop => [ qw/ sybase_loader_test1 / ], - count => 7, + count => 9, run => sub { my ($schema, $monikers, $classes) = @_; @@ -55,7 +56,7 @@ my $tester = dbixcsl_common_tests->new( { local $TODO = 'constant DEFAULT introspection'; - is $rsrc->column_info('charfield')->{default}, + is $rsrc->column_info('charfield')->{default_value}, 'foo', 'constant DEFAULT is correct'; } @@ -70,6 +71,22 @@ my $tester = dbixcsl_common_tests->new( or diag "Data type is: ", $rsrc->column_info('computed_dt')->{data_type} ; + + { + local $TODO = 'default_value for computed columns'; + + my $computed_dt_default = + $rsrc->column_info('computed_dt')->{default_value}; + + ok ((ref $computed_dt_default eq 'SCALAR'), + 'default_value for computed column is a scalar ref') +# or diag "default_value is: ", $computed_dt_default + ; + + eval { is $$computed_dt_default, + 'getdate()', + 'default_value for computed column is correct' }; + } }, }, );