]>
Commit | Line | Data |
---|---|---|
d161c455 TB |
1 | # This might look like shell script, but it's actually -*- perl -*- |
2 | use strict;use warnings; | |
3 | use lib qw(t/ t/m/); | |
4 | ||
5 | use File::Slurp; | |
6 | use Test::More qw(no_plan); | |
7 | ||
8 | use TestUtils; | |
9 | use HTML::TreeBuilder; | |
10 | use HTML::Element::Library; | |
11 | ||
12 | sub tage { | |
13 | ||
14 | my $root = "t/html/crunch/crunch"; | |
15 | ||
16 | my $tree = HTML::TreeBuilder->new_from_file("$root.initial")->guts; | |
17 | ||
18 | ||
19 | $tree->crunch(look_down => [ class => 'imageElement' ], leave => 1); | |
20 | ||
21 | my $generated_html = ptree($tree, "$root.gen"); | |
22 | ||
23 | is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for crunch"); | |
24 | } | |
25 | ||
26 | ||
27 | tage(); | |
28 |