use Test::More tests => 13; # should add some more use HTML::Microformats; my $html = <<'HTML';

2001-02-03T01:02:03+0100 Event 01 - basic

3 Feb Event 02 - value-title

3 Feb Event 03 - value-title with space

2001-02-03 01:02:03 +0100 Event 04 - splitting things up

+0100 01:02:03 2001-02-03 Event 05 - mixing them up

Z 01:02:03 2001-02-03 Event 06 - testing 'Z' timezone

+0100 1am 2001-02-03 Event 07 - test 1am

+0100 1 pm 2001-02-03 Event 08 - test 1pm

+0100 01.02 p. M. 2001-02-03 Event 09 - test 01.02 p.M.

+0100 01.02.03 p.M. 2001-02-03 Event 10 - test 01.02.03 p.M.

+0100 01.02.03 p.M. 2001-02-03 1.7.3 pm Event 11 - dtend feedthrough from dtstart (with 'value')

+0100 01.02.03 p.M. 2001-02-03 13:07:03 Event 12 - dtend feedthrough from dtstart (no 'value')

XXX 3 Feb Todo 01 - invalid value-title

HTML my $document = HTML::Microformats->new_document($html, 'http://example.com/'); $document->assume_all_profiles; my ($calendar) = $document->objects('hCalendar'); my @events = sort { $a->data->{summary} cmp $b->data->{summary} } @{ $calendar->get_vevent }; is($events[0]->get_dtstart, '2001-02-03T01:02:03+0100', $events[0]->get_summary); is($events[1]->get_dtstart, '2001-02-03T01:02:03+0100', $events[1]->get_summary); is($events[2]->get_dtstart, '2001-02-03T01:02:03+0100', $events[2]->get_summary); is($events[3]->get_dtstart, '2001-02-03T01:02:03+0100', $events[3]->get_summary); is($events[4]->get_dtstart, '2001-02-03T01:02:03+0100', $events[4]->get_summary); is($events[5]->get_dtstart, '2001-02-03T01:02:03+0000', $events[5]->get_summary); is($events[6]->get_dtstart, '2001-02-03T01:00+0100', $events[6]->get_summary); is($events[7]->get_dtstart, '2001-02-03T13:00+0100', $events[7]->get_summary); is($events[8]->get_dtstart, '2001-02-03T13:02+0100', $events[8]->get_summary); is($events[9]->get_dtstart, '2001-02-03T13:02:03+0100', $events[9]->get_summary); is($events[10]->get_dtend, '2001-02-03T13:07:03+0100', $events[10]->get_summary); is($events[11]->get_dtend, '2001-02-03T13:07:03+0100', $events[11]->get_summary); my @todos = sort { $a->data->{summary} cmp $b->data->{summary} } @{ $calendar->get_vtodo }; is($todos[0]->get_dtstart, undef, $todos[0]->get_summary);