CGI::FormBuilder::Test - Test harness for FormBuilder


CGI-FormBuilder documentation Contained in the CGI-FormBuilder distribution.

Index


Code Index:

NAME

Top

CGI::FormBuilder::Test - Test harness for FormBuilder

SYNOPSIS

Top

    use CGI::FormBuilder::Test;

    my $test = 1;
    for (@tests) {
        my $outfile = outfile($test++);

    }

DESCRIPTION

Top

REVISION

Top

$Id: Test.pm 100 2007-03-02 18:13:13Z nwiger $

AUTHOR

Top

Copyright (c) 2005-2006 Nate Wiger <nate@wiger.org>. All Rights Reserved.

This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit.


CGI-FormBuilder documentation Contained in the CGI-FormBuilder distribution.
###########################################################################
# Copyright (c) 2000-2006 Nate Wiger <nate@wiger.org>. All Rights Reserved.
# Please visit www.formbuilder.org for tutorials, support, and examples.
###########################################################################

package CGI::FormBuilder::Test;

use strict;
use warnings;
no  warnings 'uninitialized';

use CGI::FormBuilder::Util;

our $REVISION = do { (my $r='$Revision: 100 $') =~ s/\D+//g; $r };
our $VERSION = '3.0501';
our $DEBUG = 0;

use Exporter;
use base 'Exporter';
our @EXPORT = qw(outfile);

use File::Basename 'fileparse';
use File::Spec::Functions;

sub outfile ($) {
    my($file, $dir) = fileparse($0);
    $file =~ s/-.*//;   # just save "1a-", "3d-", etc
    my $out = catfile($dir, sprintf("$file-test%2.2d.html", $_[0]));
    open(O, $out) || warn "Can't open $out: $!\n";
    return join '', <O>;
}

1;