File: axis-datetime.t

package info (click to toggle)
libchart-clicker-perl 2.90-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 696 kB
  • sloc: perl: 4,379; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use Test::More;

BEGIN {
    use_ok('Chart::Clicker::Axis::DateTime');
}

my $a = Chart::Clicker::Axis::DateTime->new(
    position => 'left',format => '%H:%M:%S', orientation => 'vertical'
);
isa_ok($a, 'Chart::Clicker::Axis::DateTime');
my $foo = $a->format_value(time);
ok($foo =~ /\d+:\d+:\d/, 'Formatted Properly');

my $dt = DateTime->new(
    'year'  => 2007,
    'month' => 8,
    'day'   => 30,
    'hour'  => 18,
    'minute'=> 53,
    'second'=> 00,
    'time_zone' => 'America/Chicago'
);

$a->time_zone('UTC');
my $formatted = $a->format_value($dt->epoch);
cmp_ok($formatted, 'eq', '23:53:00', 'Proper formatting with timezone');

done_testing;