File Coverage

lib/CGI/FormBuilder/Test.pm
Criterion Covered Total %
statement 29 29 100.0
branch 1 2 50.0
condition n/a
subroutine 9 9 100.0
pod 0 1 0.0
total 39 41 95.1


line stmt bran cond sub pod time code
1              
2             ###########################################################################
3             # Copyright (c) Nate Wiger http://nateware.com. All Rights Reserved.
4             # Please visit http://formbuilder.org for tutorials, support, and examples.
5             ###########################################################################
6              
7             package CGI::FormBuilder::Test;
8              
9             =head1 NAME
10              
11             CGI::FormBuilder::Test - Test harness for FormBuilder
12              
13             =head1 SYNOPSIS
14              
15             use CGI::FormBuilder::Test;
16              
17             my $test = 1;
18             for (@tests) {
19             my $outfile = outfile($test++);
20              
21             }
22              
23             =cut
24              
25 9     9   6070 use strict;
  9         24  
  9         433  
26 9     9   76 use warnings;
  9         18  
  9         681  
27 9     9   52 no warnings 'uninitialized';
  9         16  
  9         412  
28              
29 9     9   49 use CGI::FormBuilder::Util;
  9         17  
  9         1720  
30              
31              
32             our $VERSION = '3.20';
33             our $DEBUG = 0;
34              
35 9     9   58 use Exporter;
  9         19  
  9         438  
36 9     9   61 use base 'Exporter';
  9         16  
  9         1661  
37             our @EXPORT = qw(outfile);
38              
39 9     9   72 use File::Basename 'fileparse';
  9         18  
  9         683  
40 9     9   5020 use File::Spec::Functions;
  9         9560  
  9         2832  
41              
42             sub outfile ($) {
43 84     84 0 674837 my($file, $dir) = fileparse($0);
44 84         536 $file =~ s/-.*//; # just save "1a-", "3d-", etc
45 84         971 my $out = catfile($dir, sprintf("$file-test%2.2d.html", $_[0]));
46 84 50       6115 open(O, $out) || warn "Can't open $out: $!\n";
47 84         9458 return join '', ;
48             }
49              
50             1;
51              
52             =head1 DESCRIPTION
53              
54             =head1 REVISION
55              
56             $Id: Test.pm 100 2007-03-02 18:13:13Z nwiger $
57              
58             =head1 AUTHOR
59              
60             Copyright (c) L. All Rights Reserved.
61              
62             This module is free software; you may copy this under the terms of
63             the GNU General Public License, or the Artistic License, copies of
64             which should have accompanied your Perl kit.
65              
66             =cut