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