Bump version to 0.12.0
[WWW-OrangeHRM-Client.git] / t / normalize_duration.t
blob3714447e11efe86f0dcfee5a11fc42565bf8c7d9
1 use strict;
2 use warnings;
3 use Test::More tests => 10;
4 use DateTime::Duration;
6 BEGIN {
7     use_ok('WWW::OrangeHRM::Client', qw(normalize_duration));
10 is(
11     normalize_duration('12:34'),
12     '12:34',
13     '12:34'
16 is(
17     normalize_duration('12'),
18     '12:00',
19     '12 hours'
22 is(
23     normalize_duration('01:02'),
24     '01:02',
25     '01:02'
28 is(
29     normalize_duration('1:2'),
30     '01:02',
31     '1:2'
34 is(
35     normalize_duration('x1:2'),
36     'x1:2',
37     'x1:2'
40 is(
41     normalize_duration('1:x2'),
42     '1:x2',
43     '1:x2'
46 is(
47     normalize_duration('x'),
48     'x',
49     'x'
52 is(
53     normalize_duration(''),
54     '00:00',
55     'empty string'
58 is(
59     normalize_duration(undef),
60     undef,
61     'undef'