]> iEval git - html-element-library.git/blame - t/crunch.t
implement and test crunch method
[html-element-library.git] / t / crunch.t
CommitLineData
d161c455
TB
1# This might look like shell script, but it's actually -*- perl -*-
2use strict;use warnings;
3use lib qw(t/ t/m/);
4
5use File::Slurp;
6use Test::More qw(no_plan);
7
8use TestUtils;
9use HTML::TreeBuilder;
10use HTML::Element::Library;
11
12sub 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
27tage();
28
This page took 0.018011 seconds and 4 git commands to generate.