File: parse_datetime5.t

package info (click to toggle)
libdatetime-format-pg-perl 0.16013-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 268 kB
  • ctags: 224
  • sloc: makefile: 492; perl: 386
file content (10 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
use Test::More tests => 1;
use DateTime::Format::Pg 0.02;

# This test fails when nanosecond is not converted properly to an integer. This
# happens when the fractional part of timestamp is .254182 - got this number by
# experiment.
{
  my $dt = DateTime::Format::Pg->parse_datetime('2017-05-02 12:39:10.254182+00');
  cmp_ok($dt->nanosecond(), '==', 254182000, 'nanosecond as a number');
}