3 use Test::More tests => 15;
4 use DateTime::Duration;
7 use_ok('WWW::OrangeHRM::Client', qw(string2time_duration));
11 !DateTime::Duration->compare(
12 string2time_duration('12:34'),
13 DateTime::Duration->new(hours=>12, minutes=>34)
18 !DateTime::Duration->compare(
19 string2time_duration('12'),
20 DateTime::Duration->new(hours=>12, minutes=>00)
26 !DateTime::Duration->compare(
27 string2time_duration('01:02'),
28 DateTime::Duration->new(hours=>1, minutes=>2)
34 !DateTime::Duration->compare(
35 string2time_duration('1:2'),
36 DateTime::Duration->new(hours=>1, minutes=>2)
42 string2time_duration('x1:2'),
48 string2time_duration('x1:2', 1),
54 string2time_duration('1:x2'),
60 string2time_duration('1:x2', 1),
66 string2time_duration('x'),
72 string2time_duration('x', 1),
78 !DateTime::Duration->compare(
79 string2time_duration(''),
80 DateTime::Duration->new(hours=>0, minutes=>0)
86 !DateTime::Duration->compare(
87 string2time_duration('', 1),
88 DateTime::Duration->new(hours=>0, minutes=>0)
90 'strict emptry string'
94 string2time_duration(undef),
100 string2time_duration(undef, 1),