1 # This might look like shell script, but it's actually -*- perl -*-
2 use strict;use warnings;
10 use HTML::Element::Library;
15 my $root = "t/html/crunch/crunch";
17 my $tree = HTML::TreeBuilder->new_from_file("$root.initial")->guts;
20 $tree->crunch(look_down => [ class => 'imageElement' ], leave => 1);
22 my $generated_html = strip_ws ( ptree($tree, "$root.gen") );
23 # must put read_file() in scalar context so that a string instead of first line is returned.
24 my $expected_html = strip_ws(scalar File::Slurp::read_file("$root.exp"));
26 #warn "g:$generated_html";
27 #warn "e:$expected_html";
29 is ($generated_html, $expected_html, "HTML for crunch");