]>
Commit | Line | Data |
---|---|---|
f25dca7f TB |
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 qw(no_plan); | |
855ca7e9 | 7 | use Test::XML; |
f25dca7f TB |
8 | |
9 | use TestUtils; | |
10 | use HTML::TreeBuilder; | |
11 | use HTML::Element::Library; | |
12 | ||
13 | sub tage { | |
14 | ||
15 | my $root = "t/html/defmap/defmap"; | |
16 | ||
17 | my $tree = HTML::TreeBuilder->new_from_file("$root.initial")->guts; | |
18 | ||
19 | #warn "TREE: $tree" . $tree->as_HTML; | |
20 | ||
21 | my %data = (pause => 'arsenal rules'); | |
22 | ||
9a087986 | 23 | $tree->defmap(smap => \%data, 1); |
f25dca7f | 24 | |
855ca7e9 TB |
25 | my $g = ptree($tree, "$root.gen"); |
26 | my $e = File::Slurp::read_file("$root.exp"); | |
27 | warn "generated:$g:\nexpected:$e:"; | |
f25dca7f | 28 | |
855ca7e9 | 29 | is_xml ($g, $e, "HTML for defmap"); |
f25dca7f TB |
30 | } |
31 | ||
32 | ||
33 | tage(); | |
34 |