From: Rafael Kitover Date: Tue, 23 Jun 2009 23:36:12 +0000 (+0000) Subject: properly test nanosecond precision with oracle and datetime_setup X-Git-Tag: v0.08108~48^2~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d3d8b2a66795078aa1fc9683e1f3ba280609a44;p=dbsrgits%2FDBIx-Class.git properly test nanosecond precision with oracle and datetime_setup --- diff --git a/t/73oracle_inflate.t b/t/73oracle_inflate.t index 949a6c3..22fabce 100644 --- a/t/73oracle_inflate.t +++ b/t/73oracle_inflate.t @@ -17,7 +17,7 @@ else { plan skip_all => 'needs DateTime and DateTime::Format::Oracle for testing'; } else { - plan tests => 9; + plan tests => 10; } } @@ -81,7 +81,7 @@ $schema->connection($dsn, $user, $pass, { $dt = DateTime->now(); my $timestamp = $dt->clone; -$timestamp->millisecond( 80 ); +$timestamp->set_nanosecond( int 500_000_000 ); $track = $schema->resultset('Track')->find( 1 ); $track->update({ last_updated_on => $dt, last_updated_at => $timestamp }); @@ -91,6 +91,9 @@ $track = $schema->resultset('Track')->find(1); is( $track->last_updated_on, $dt, 'DateTime round-trip as DATE' ); is( $track->last_updated_at, $timestamp, 'DateTime round-trip as TIMESTAMP' ); +is( int $track->last_updated_at->nanosecond, int 500_000_000, + 'TIMESTAMP nanoseconds survived' ); + # clean up our mess END { if($schema && ($dbh = $schema->storage->dbh)) {