]>
Commit | Line | Data |
---|---|---|
67e78ff2 | 1 | # This might look like shell script, but it's actually -*- perl -*- |
2 | use strict; | |
67e78ff2 | 3 | |
4 | use File::Slurp; | |
5 | use Test::More qw(no_plan); | |
6 | ||
67e78ff2 | 7 | use HTML::TreeBuilder; |
8 | use HTML::Element::Library; | |
d4b9a41a | 9 | use Test::XML; |
67e78ff2 | 10 | |
11 | my $root = 't/html/iter'; | |
12 | ||
13 | my $tree = HTML::TreeBuilder->new_from_file("$root.html"); | |
14 | ||
15 | my $li = $tree->look_down(class => 'store_items'); | |
16 | ||
17 | my @items = qw(bread butter vodka); | |
18 | ||
19 | $tree->iter($li, @items); | |
20 | ||
67e78ff2 | 21 | |
d4b9a41a | 22 | is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), |
67e78ff2 | 23 | "HTML for generated li"); |