use strict; use warnings; use Test::More tests => 7; use_ok ('Formatter::HTML::HTML'); my $data = <<'_EOD_'; Tidy Formatter test

This is a test of Formatter::HTML::HTML, which can be found at
CPAN

It has been written by Kjetil Kjernsmo in the hope it will be useful for someone. _EOD_ my $fragexpected = <<'_EOD_';

This is a test of Formatter::HTML::HTML, which can be found at
CPAN

It has been written by Kjetil Kjernsmo in the hope it will be useful for someone.

_EOD_ my $docexpected = <<'_EOD_'; Tidy Formatter test

This is a test of Formatter::HTML::HTML, which can be found at
CPAN

It has been written by Kjetil Kjernsmo in the hope it will be useful for someone.

_EOD_ my $text = Formatter::HTML::HTML->format($data); isa_ok( $text, 'Formatter::HTML::HTML' ); ok($text->fragment eq $fragexpected, 'Fragment comes out as expected'); TODO: { local $TODO = "This currently depends on having the same version of tidy as the developer"; ok($text->document eq $docexpected, 'Document comes out as expected'); } ok($text->title eq 'Tidy Formatter test', 'Title is correct'); ok(my $links = $text->links, 'Assigning links'); my $expectedlinks = [ { 'title' => 'CPAN', 'url' => 'http://search.cpan.org/dist/Formatter-HTML-HTML/' }, { 'title' => 'Kjetil Kjernsmo', 'url' => 'http://www.kjetil.kjernsmo.net/' }]; ok(eq_array($expectedlinks, $links), 'All links and titles match');