]> iEval git - html-element-library.git/blob - t/passover.t
fixed test suite
[html-element-library.git] / t / passover.t
1 # This might look like shell script, but it's actually -*- perl -*-
2 use strict;
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 replace_age {
13 my $branch = shift;
14 my $age = shift;
15 $branch->look_down(id => 'age')->replace_content($age);
16 }
17
18
19 sub tage {
20 my $age = shift;
21
22 my $tree = HTML::TreeBuilder->new_from_file('t/html/highlander2.html');
23
24 my $saved_child = $tree->passover('under18');
25
26 my $root = "t/html/highlander2-passover";
27
28 my $generated_html = ptree($tree, "$root.gen");
29
30 is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for $age");
31 }
32
33
34 tage('666');
35
This page took 0.043477 seconds and 4 git commands to generate.