File: self_circle.t

package info (click to toggle)
libdatetime-format-pg-perl 0.16007-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 276 kB
  • sloc: perl: 1,656; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use Test::More tests => 4;
use DateTime::Format::Pg 0.02;

my @ts = (
    "2007-03-10 06:00:00+01",
    "2007-03-10 06:00:00-0100",
);

foreach my $ts (@ts) {
    my $dt = DateTime::Format::Pg->parse_datetime($ts);
    my $dt_formated = DateTime::Format::Pg->format_datetime($dt);

    # Pg will truncate timezone like +0100 to +01
    $ts =~ s/([+\-]\d{2})$/${1}00/;
    is($dt_formated, $ts, "format ok");
    ok(DateTime::Format::Pg->parse_datetime($dt_formated));

}