]>
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; | |
271d5078 | 6 | use Test::More; |
d161c455 TB |
7 | |
8 | use TestUtils; | |
9 | use HTML::TreeBuilder; | |
10 | use HTML::Element::Library; | |
70669dc1 | 11 | use Test::XML; |
d161c455 TB |
12 | |
13 | sub tage { | |
14 | ||
15 | my $root = "t/html/crunch/crunch"; | |
16 | ||
17 | my $tree = HTML::TreeBuilder->new_from_file("$root.initial")->guts; | |
18 | ||
19 | ||
20 | $tree->crunch(look_down => [ class => 'imageElement' ], leave => 1); | |
21 | ||
22 | my $generated_html = ptree($tree, "$root.gen"); | |
23 | ||
70669dc1 | 24 | is_xml ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for crunch"); |
d161c455 TB |
25 | } |
26 | ||
27 | ||
28 | tage(); | |
29 | ||
271d5078 | 30 | done_testing; |