File: DateTime.t

package info (click to toggle)
libdbix-class-helpers-perl 2.036000-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,008 kB
  • sloc: perl: 5,041; sql: 537; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 486 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;

use lib 't/lib';
use Test::More;

use TestSchema;
use DateTime;

TestSchema->load_components('Helper::Schema::DateTime');
my $schema = TestSchema->deploy_or_connect();

isa_ok($schema->datetime_parser, 'DateTime::Format::SQLite');
my $dt = DateTime->now;
my $s = $schema->format_datetime($dt);
is(
   $schema->format_datetime($schema->parse_datetime($s)),
   $schema->format_datetime($dt),
   'format_datetime and parse_datetime roundtrip',
);

done_testing;