| 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 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 9 | ▶ | no warnings 'uninitialized'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | |||||||||||
| 29 | 9 | ▶ | use CGI::FormBuilder::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | |||||||||||
| 31 | |||||||||||
| 32 | 9 | our $VERSION = '3.10'; | |||||||||
| 33 | 9 | our $DEBUG = 0; | |||||||||
| 34 | |||||||||||
| 35 | 9 | ▶ | use Exporter; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 36 | 9 | ▶ | use base 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 37 | 9 | our @EXPORT = qw(outfile); | |||||||||
| 38 | |||||||||||
| 39 | 9 | ▶ | use File::Basename 'fileparse'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 40 | 9 | ▶ | use File::Spec::Functions; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 41 | |||||||||||
| 42 | sub outfile ($) { | ||||||||||
| 43 | 84 | ▶ | my($file, $dir) = fileparse($0); | ||||||||
|
Subroutine
outfile: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 44 | 84 | $file =~ s/-.*//; # just save "1a-", "3d-", etc | |||||||||
| 45 | 84 | my $out = catfile($dir, sprintf("$file-test%2.2d.html", $_[0])); | |||||||||
| 46 | 84 | ▶ | open(O, $out) || warn "Can't open $out: $!\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | 84 | return join '', <O>; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 9 | 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<Nate Wiger|http://nateware.com>. 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 | ||||||||||