use strict;
-use warnings;
+use warnings;
use Test::More;
use Test::Exception;
plan skip_all =>
'Set $ENV{DBICTEST_SYBASE_DSN}, _USER and _PASS to run this test' .
"\nWarning: This test drops and creates a table called 'track'";
-} else {
- eval "use DateTime; use DateTime::Format::Sybase;";
- if ($@) {
- plan skip_all => 'needs DateTime and DateTime::Format::Sybase for testing';
- }
}
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_ase')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_ase');
+
my @storage_types = (
'DBI::Sybase::ASE',
'DBI::Sybase::ASE::NoBindVars',
# minute precision
['SMALLDATETIME', 'small_dt', '2004-08-21T14:36:00.000Z'],
);
-
+
for my $dt_type (@dt_types) {
my ($type, $col, $sample_dt) = @$dt_type;
->search({ trackid => $row->trackid }, { select => [$col] })
->first
);
- is( $row->$col, $dt, 'DateTime roundtrip' );
+ is( $row->$col, $dt, "$type roundtrip" );
+
+ is( $row->$col->nanosecond, $dt->nanosecond,
+ 'fractional DateTime portion roundtrip' )
+ if $dt->nanosecond > 0;
}
# test a computed datetime column