]> iEval git - html-element-library.git/blame - t/same_as.t
fixed test suite
[html-element-library.git] / t / same_as.t
CommitLineData
3dad7198
TB
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
21 my $root = "t/html/same_as/same_as";
22
23 my $tree = HTML::TreeBuilder->new_from_file("$root.initial");
24
9b7a5679 25 #warn "TREE: $tree" . $tree->as_HTML;
3dad7198 26
d9f4bd5a
TB
27 my %data = (people_id => 888, phone => '444-4444', email => 'm@xml.com');
28
29 $tree->hash_map
30 (hash => \%data,
31 to_attr => 'sid',
32 excluding => [ 'email' ],
33 debug => 1
34 );
3dad7198
TB
35
36 my $generated_html = ptree($tree, "$root.gen");
37
38 is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for same_as");
39}
40
41
42tage();
43
This page took 0.028676 seconds and 4 git commands to generate.