]> iEval git - html-element-library.git/blob - t/TestUtils.pm
Remove HTML::Element::Library::Changes
[html-element-library.git] / t / TestUtils.pm
1 package TestUtils;
2
3 use HTML::PrettyPrinter;
4 use FileHandle;
5 use File::Slurp;
6
7 require Exporter;
8 @ISA=qw(Exporter);
9 @EXPORT = qw(ptree html_dir strip_ws);
10
11 sub html_dir {
12 't/html/'
13 }
14
15 sub ptree {
16 my $tree = shift or die 'must supply tree';
17 my $out = shift or die 'must supply outfile';
18
19 my $hpp = HTML::PrettyPrinter->new
20 (tabify => 0, allow_forced_nl => 1, quote_attr => 1);
21 my $lines = $hpp->format($tree);
22
23 write_file $out, @$lines;
24 join '', @$lines;
25 }
26
27 sub strip_ws {
28 my($str)=@_;
29
30 $str =~ s/\s+//g;
31 $str;
32 }
33
34
35 1;
This page took 0.0360470000000001 seconds and 4 git commands to generate.