use Test::More tests => 7; use HTML::HTML5::Outline 0.004 rdf => 0; my $xhtml = <<'XHTML'; Test

Hello

Universe

Possibility of a Multiverse?

What's a Multiverse?

In Layman's Terms

In Astrophysics

World

Country

Goodbye

Cruel World

XHTML my $data = HTML::HTML5::Outline ->new($xhtml, uri => 'http://example.com/') ->to_hashref ; ok(defined $data, 'An outline was generated.'); is($data->{class}, 'Outline', 'root is an outline'); is(scalar @{$data->{children}}, 2, 'root contains two child sections'); is($data->{children}[0]{header}{content}, 'Hello', 'first section correct title'); is($data->{children}[1]{header}{content}, 'Goodbye', 'second section correct title'); is($data->{children}[0]{children}[0]{children}[0]{children}[0]{class}, 'Outline', 'nested outline found'); is($data->{children}[0]{children}[0]{children}[0]{children}[0]{children}[0]{header}{content}, "What's a Multiverse?", 'nested outline seems in order');