]> iEval git - html-element-library.git/blob - t/crunch.t
Remove HTML::Element::Library::Changes
[html-element-library.git] / t / crunch.t
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;
7
8 use TestUtils;
9 use HTML::TreeBuilder;
10 use HTML::Element::Library;
11 use Test::XML;
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 = 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"));
25
26 #warn "g:$generated_html";
27 #warn "e:$expected_html";
28
29 is ($generated_html, $expected_html, "HTML for crunch");
30 }
31
32
33 tage();
34
35 done_testing;
This page took 0.040059 seconds and 4 git commands to generate.