]> iEval git - html-element-library.git/blob - t/m/TestUtils.pm
first commit
[html-element-library.git] / t / m / TestUtils.pm
1 package TestUtils;
2
3 use HTML::PrettyPrinter;
4 use FileHandle;
5 use File::Slurp;
6
7 use Carp qw(carp cluck croak confess);
8
9 require Exporter;
10 @ISA=qw(Exporter);
11 @EXPORT = qw(ptree html_dir);
12
13 sub html_dir {
14 't/html/'
15 }
16
17 sub ptree {
18 my $tree = shift or confess 'must supply tree';
19 my $out = shift or confess 'must supply outfile';
20
21 my $hpp = HTML::PrettyPrinter->new
22 (tabify => 0, allow_forced_nl => 1, quote_attr => 1);
23 my $lines = $hpp->format($tree);
24
25 write_file $out, @$lines;
26 join '', @$lines;
27 }
28
29
30
31 1;
This page took 0.020731 seconds and 4 git commands to generate.