use Test::More tests => 10; use HTML::Microformats; my $html = <<'HTML';

First

World (0, 0)

First

Hello

World

Second

Bob
Alice
HTML my $document = HTML::Microformats->new_document($html, 'http://example.com/'); $document->assume_all_profiles; my ($blog, $news) = sort { $a->element->getAttribute('id') cmp $b->element->getAttribute('id') } $document->objects('hAtom'); my @blog_entries = @{ $blog->get_entry }; is( scalar @blog_entries, 2, "Two entries found in blog."); my @news_entries = @{ $news->get_entry }; is( scalar @news_entries, 1, "One entry found in news."); ok($news_entries[0]->isa('HTML::Microformats::Format::hNews'), 'News item is a news item'); ok($news_entries[0]->isa('HTML::Microformats::Format::hEntry'), 'News item is an entry'); is($news_entries[0]->data->{title}, 'First', 'News item has correct entry-title'); is($news_entries[0]->get_author->[0]->get_fn, 'Alice', 'Implied author'); is($news_entries[0]->get_geo->[0]->get_latitude, '0', 'News item has a geo'); my ($votelink) = $document->objects('VoteLinks'); is($votelink->get_voter->[0]->get_fn, 'Alice', 'hEntry propagates authors to VoteLinks'); is($blog_entries[0]->data->{content}, 'HelloWorld', 'Multiple entry-content elements concatenated'); is($document->model->count_statements( undef, RDF::Trine::Node::Resource->new('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), RDF::Trine::Node::Resource->new('http://bblfish.net/work/atom-owl/2006-06-06/#Entry'), ), 3, 'Three atom:Entry resources output (RDF)');