X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Finflate%2Fdatetime_firebird.t;h=714c127a0f5b568bcbe31c9a20b62dc61e61d3fa;hb=32323fc22fa9fb54fc1a4702358450ce5a38b803;hp=9212f37ac563e98c1e8fd75d4abaf86999c30d2b;hpb=9cd0b325352c34448af2630f6cfdf3ada060bfba;p=dbsrgits%2FDBIx-Class.git diff --git a/t/inflate/datetime_firebird.t b/t/inflate/datetime_firebird.t index 9212f37..714c127 100644 --- a/t/inflate/datetime_firebird.t +++ b/t/inflate/datetime_firebird.t @@ -32,14 +32,12 @@ my @info = ( my $schema; -foreach my $info (@info) { - my ($dsn, $user, $pass) = @$info; +foreach my $conn_idx (0..$#info) { + my ($dsn, $user, $pass) = @{ $info[$conn_idx] }; next unless $dsn; - $schema = DBICTest::Schema->clone; - - $schema->connection($dsn, $user, $pass, { + $schema = DBICTest::Schema->connect($dsn, $user, $pass, { on_connect_call => [ 'datetime_setup' ], }); @@ -53,6 +51,7 @@ foreach my $info (@info) { ) SQL my $now = DateTime->now; + $now->set_nanosecond(555600000); my $row; ok( $row = $schema->resultset('Event')->create({ id => 1, @@ -62,7 +61,12 @@ SQL ->search({ id => 1 }, { select => ['created_on'] }) ->first ); - is( $row->created_on, $now, 'DateTime roundtrip' ); + is $row->created_on, $now, 'DateTime roundtrip'; + + if ($conn_idx == 0) { # skip for ODBC + cmp_ok $row->created_on->nanosecond, '==', 555600000, + 'fractional part of a second survived'; + } } done_testing;