]> iEval git - html-element-library.git/blame - t/passover.t
hash_map method about to be public for real
[html-element-library.git] / t / passover.t
CommitLineData
8dfa206c 1# This might look like shell script, but it's actually -*- perl -*-
2use strict;
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 replace_age {
13 my $branch = shift;
14 my $age = shift;
15 $branch->look_down(id => 'age')->replace_content($age);
16}
17
18
19sub 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
34tage('666');
35
This page took 0.022221 seconds and 4 git commands to generate.