use strict; use warnings; use Test::More tests => 19; use Subtitle::TimePoint; my $p = Subtitle::TimePoint->new; is(ref $p, 'Subtitle::TimePoint'); can_ok($p, qw(new parse time shift)); # valid timespec is($p->parse('0/0'), undef); is($p->time, 0.0), is($p->shift, 0.0); is($p->parse('0.3/0'), undef); is($p->time, 0.3), is($p->shift, 0.0); is($p->parse('1:17/-4.1'), undef); is($p->time, 77), is($p->shift, -4.1); is($p->parse('2:15:03.515/+3:02.7'), undef); is($p->time, 8103.515), is($p->shift, 182.7); # invalid timespec is($p->parse('0.3/-'), "wrong timespec, expected