Enter your name:
>
FYI, your dress size is
CGI-FormBuilder-3.09/t/PaxHeader/2a-test01.html 000644 777777 777777 00000000214 12246225402 021016 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715774
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2a-test01.html 000644 € _$D€ q{Ì00000002574 12246225402 017343 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
CGI-FormBuilder-3.09/t/PaxHeader/2a-test02.html 000644 777777 777777 00000000214 12246225402 021017 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715775
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2a-test02.html 000644 € _$D€ q{Ì00000001152 12246225402 017333 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
CGI-FormBuilder-3.09/t/PaxHeader/2a-test03.html 000644 777777 777777 00000000214 12246225402 021020 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715776
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2a-test03.html 000644 € _$D€ q{Ì00000004003 12246225402 017332 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
CGI-FormBuilder-3.09/t/PaxHeader/2a-test04.html 000644 777777 777777 00000000214 12246225402 021021 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715777
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2a-test04.html 000644 € _$D€ q{Ì00000002227 12246225402 017341 0 ustar 00nateware 000000 000000
Test
CGI-FormBuilder-3.09/t/PaxHeader/2a-test99.html 000644 777777 777777 00000000214 12246225402 021037 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715778
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2a-test99.html 000644 € _$D€ q{Ì00000001264 12246225402 017357 0 ustar 00nateware 000000 000000
Test
:
CGI-FormBuilder-3.09/t/PaxHeader/2b-template-text.t 000644 777777 777777 00000000214 12246226374 022004 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715779
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2b-template-text.t 000644 € _$D€ q{Ì00000010705 12246226374 020324 0 ustar 00nateware 000000 000000 #!/usr/bin/perl
# Copyright (c) 2000-2006 Nathan Wiger .
# All Rights Reserved. If you're reading this, you're bored.
# 2b-template-text.t - test Text::Template support
use strict;
our $TESTING = 1;
our $DEBUG = $ENV{DEBUG} || 0;
our $LOGNAME = $ENV{LOGNAME} || '';
our $VERSION;
BEGIN { $VERSION = '3.09'; }
use Test;
use FindBin;
# use a BEGIN block so we print our plan before CGI::FormBuilder is loaded
our $SKIP;
BEGIN {
my $numtests = 4;
unshift @INC, "$FindBin::Bin/../lib";
plan tests => $numtests;
# try to load template engine so absent template does
# not cause all tests to fail
eval "require Text::Template";
$SKIP = $@ ? 'skip: Text::Template not installed here' : 0;
# success if we said NOTEST
if ($ENV{NOTEST}) {
ok(1) for 1..$numtests;
exit;
}
}
# Need to fake a request or else we stall
$ENV{REQUEST_METHOD} = 'GET';
$ENV{QUERY_STRING} = 'ticket=111&user=pete&replacement=TRUE';
use CGI::FormBuilder 3.09;
use CGI::FormBuilder::Test;
# Create our template and store it in a scalarref
my $template = outfile(0);
# What options we want to use, and what we expect to see
my @test = (
{
opt => { fields => [qw/name color/],
submit => 'No esta una button del resetto',
template => { type => 'Text', TYPE => 'STRING', template => $template, },
validate => { name => 'NAME' },
},
mod => { color => { options => [qw/red green blue/],
label => 'Best Color', value => 'red' },
size => { value => 42 },
sex => { options => [[M=>'Male'],[F=>'Female']] }
},
},
{
opt => { fields => [qw/name color size/],
template => { type => 'Text', TYPE => 'STRING', template => $template, },
values => {color => [qw/purple/], size => 8},
submit => 'Start over, boob!',
},
mod => { color => { options => [[white=>'White'],[black=>'Black'],[red=>'Green']],
label => 'Mom', },
name => { size => 80, maxlength => 80, comment => 'Fuck off' },
sex => { options => [[1=>'Yes'], [0=>'No'], [-1=>'Maybe']],
label => 'Fuck me? ' },
},
},
{
opt => { fields => [qw/name color email/], submit => [qw/Update Delete/], reset => 0,
template => { type => 'Text', TYPE => 'STRING', template => $template, },
values => {color => [qw/yellow green orange/]},
validate => { sex => [qw(1 3 5)] },
},
mod => { color => {options => [[red => 1], [blue => 2], [yellow => 3], [pink => 4]] },
size => {comment => '(unknown)', value => undef, force => 1 } ,
sex => {label => 'glass EYE fucker', options => [[1,2],[3,4],[5,6]] },
},
},
);
# Perl 5 is sick sometimes.
@test = @test[$ARGV[0] - 1] if @ARGV;
my $seq = $ARGV[0] || 1;
# Cycle thru and try it out
for (@test) {
my $form = CGI::FormBuilder->new(
debug => $DEBUG,
action => 'TEST',
title => 'TEST',
%{ $_->{opt} },
);
# the ${mod} key twiddles fields
while(my($f,$o) = each %{$_->{mod} || {}}) {
$o->{name} = $f;
$form->field(%$o);
}
#
# Just compare the output of render with what's expected
# the correct string output is now in external files.
# The seemingly extra eval is required so that failures
# to import the template modules do not kill the tests.
# (since render is called regardless of whether $SKIP is set)
#
my $out = outfile($seq++);
my $ren = $SKIP ? '' : $form->render;
my $ok = skip($SKIP, $ren, $out);
if (! $ok && $LOGNAME eq 'nwiger') {
open(O, ">/tmp/fb.1.html");
print O $out;
close O;
open(O, ">/tmp/fb.2.html");
print O $ren;
close O;
system "diff /tmp/fb.1.html /tmp/fb.2.html";
exit 1;
}
}
# MORE TESTS DOWN HERE
# from eszpee for tmpl_param
skip($SKIP, do{
my $form2 = CGI::FormBuilder->new(
template => { type => 'Text', engine => {TYPE => 'STRING', SOURCE => '<% $test %>'} }
);
$form2->tmpl_param(test => "this message should appear");
eval '$form2->render';
}, 'this message should appear');
CGI-FormBuilder-3.09/t/PaxHeader/2b-test00.html 000644 777777 777777 00000000214 12246225402 021016 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715780
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2b-test00.html 000644 € _$D€ q{Ì00000001547 12246225402 017342 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
<% $jshead %>
<% $start %><% $state %>
Enter your name: <% $field{name}{field}.$field{name}{comment} %>
Select your <% $field{color}{label} %>:
<% my $ret = '';
for (@{$field{color}{options}}) {
if (ref $_) {
$ret .= qq( $_->[1] \n);
} else {
my $chk = $_ eq $field{color}{value} ? 'selected="selected"' : '';
$ret .= qq( $_ \n);
}
}
$ret;
%>
<% my $ret = "$field{sex}{label} = ";
for (@{$field{sex}{options}}) {
$ret .= qq($_->[1] );
}
$ret;
%>
FYI, your dress size is <% $field{size}{value}.$field{size}{comment} %>
<% $submit %>
<% $end %>
CGI-FormBuilder-3.09/t/PaxHeader/2b-test01.html 000644 777777 777777 00000000214 12246225402 021017 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715781
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2b-test01.html 000644 € _$D€ q{Ì00000002741 12246225402 017340 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
CGI-FormBuilder-3.09/t/PaxHeader/2b-test02.html 000644 777777 777777 00000000214 12246225402 021020 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715782
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2b-test02.html 000644 € _$D€ q{Ì00000001304 12246225402 017333 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
CGI-FormBuilder-3.09/t/PaxHeader/2b-test03.html 000644 777777 777777 00000000214 12246225402 021021 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715783
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2b-test03.html 000644 € _$D€ q{Ì00000004155 12246225402 017343 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".
CGI-FormBuilder-3.09/t/PaxHeader/2c-template-tt2.t 000644 777777 777777 00000000214 12246226374 021532 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715784
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2c-template-tt2.t 000644 € _$D€ q{Ì00000010741 12246226374 020052 0 ustar 00nateware 000000 000000 #!/usr/bin/perl
# Copyright (c) 2000-2006 Nathan Wiger .
# All Rights Reserved. If you're reading this, you're bored.
# 2c-template-tt2.t - test Template AssKit support
use strict;
our $TESTING = 1;
our $DEBUG = $ENV{DEBUG} || 0;
our $LOGNAME = $ENV{LOGNAME} || '';
our $VERSION;
BEGIN { $VERSION = '3.09'; }
use Test;
use FindBin;
# use a BEGIN block so we print our plan before CGI::FormBuilder is loaded
our $SKIP;
BEGIN {
my $numtests = 4;
unshift @INC, "$FindBin::Bin/../lib";
plan tests => $numtests;
# try to load template engine so absent template does
# not cause all tests to fail
eval "require Template";
$SKIP = $@ ? 'skip: Template Toolkit not installed here' : 0;
# success if we said NOTEST
if ($ENV{NOTEST}) {
ok(1) for 1..$numtests;
exit;
}
}
# Need to fake a request or else we stall
$ENV{REQUEST_METHOD} = 'GET';
$ENV{QUERY_STRING} = 'ticket=111&user=pete&replacement=TRUE';
use CGI::FormBuilder 3.09;
use CGI::FormBuilder::Test;
# Create our template and store it in a scalarref
my $template = outfile(0);
# What options we want to use, and what we expect to see
my @test = (
{
opt => { fields => [qw/name color/],
submit => 'No esta una button del resetto',
template => { type => 'TT2', template => \$template, variable => 'form' },
validate => { name => 'NAME' },
},
mod => { color => { options => [qw/red green blue/],
label => 'Best Color', value => 'red' },
size => { value => 42 },
sex => { options => [[M=>'Male'],[F=>'Female']] }
},
},
{
opt => { fields => [qw/name color size/],
template => { type => 'TT2', template => \$template, variable => 'form' },
values => {color => [qw/purple/], size => 8},
submit => 'Start over, boob!',
},
mod => { color => { options => [[white=>'White'],[black=>'Black'],[red=>'Green']],
label => 'Mom', },
name => { size => 80, maxlength => 80, comment => 'Fuck off' },
sex => { options => [[1=>'Yes'], [0=>'No'], [-1=>'Maybe']],
label => 'Fuck me? ' },
},
},
{
opt => { fields => [qw/name color email/], submit => [qw/Update Delete/], reset => 0,
template => { type => 'TT2', template => \$template, variable => 'form' },
values => {color => [qw/yellow green orange/]},
validate => { sex => [qw(1 3 5)] },
},
mod => { color => {options => [[red => 1], [blue => 2], [yellow => 3], [pink => 4]] },
size => {comment => '(unknown)', value => undef, force => 1 } ,
sex => {label => 'glass EYE fucker', options => [[1,2],[3,4],[5,6]] },
},
},
{
opt => { fields => [qw/yomomma mymomma/], submit => [qw/Remove Dance_With/], reset => 1,
template => { type => 'TT2', template => \$template, variable => 'form' },
values => {mymomma => [qw/medium large xxl/]},
validate => { yomomma => 'NAME' },
},
mod => {},
},
);
# Perl 5 is sick sometimes.
@test = @test[$ARGV[0] - 1] if @ARGV;
my $seq = $ARGV[0] || 1;
# Cycle thru and try it out
for (@test) {
my $form = CGI::FormBuilder->new(
debug => $DEBUG,
action => 'TEST',
title => 'TEST',
%{ $_->{opt} },
);
# the ${mod} key twiddles fields
for my $f ( sort keys %{$_->{mod} || {}} ) {
my $o = $_->{mod}{$f};
$o->{name} = $f;
$form->field(%$o);
}
#
# Just compare the output of render with what's expected
# the correct string output is now in external files.
# The seemingly extra eval is required so that failures
# to import the template modules do not kill the tests.
# (since render is called regardless of whether $SKIP is set)
#
my $out = outfile($seq++);
my $ren = $SKIP ? '' : $form->render;
my $ok = skip($SKIP, $ren, $out);
if (! $ok && $LOGNAME eq 'nwiger') {
open(O, ">/tmp/fb.1.html");
print O $out;
close O;
open(O, ">/tmp/fb.2.html");
print O $ren;
close O;
system "diff /tmp/fb.1.html /tmp/fb.2.html";
exit 1;
}
}
CGI-FormBuilder-3.09/t/PaxHeader/2c-test00.html 000644 777777 777777 00000000214 12246225402 021017 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715785
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2c-test00.html 000644 € _$D€ q{Ì00000001363 12246225402 017337 0 ustar 00nateware 000000 000000
[% form.title %]
[% form.jshead %]
[% form.start %]
[% FOREACH field = form.fields %]
[% field.required
? "$field.label "
: field.label
%]
[% IF field.invalid %]
Missing or invalid entry, please try again.
[% END %]
[% field.field %]
[% END %]
[% form.submit %] [% form.reset %]
[% form.end %]
CGI-FormBuilder-3.09/t/PaxHeader/2c-test01.html 000644 777777 777777 00000000214 12246225402 021020 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715786
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2c-test01.html 000644 € _$D€ q{Ì00000004661 12246225402 017344 0 ustar 00nateware 000000 000000
TEST
CGI-FormBuilder-3.09/t/PaxHeader/2c-test02.html 000644 777777 777777 00000000214 12246225402 021021 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715787
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2c-test02.html 000644 € _$D€ q{Ì00000003251 12246225402 017337 0 ustar 00nateware 000000 000000
TEST
CGI-FormBuilder-3.09/t/PaxHeader/2c-test03.html 000644 777777 777777 00000000214 12246225402 021022 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715788
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2c-test03.html 000644 € _$D€ q{Ì00000006544 12246225402 017350 0 ustar 00nateware 000000 000000
TEST
CGI-FormBuilder-3.09/t/PaxHeader/2c-test04.html 000644 777777 777777 00000000214 12246225402 021023 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715789
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2c-test04.html 000644 € _$D€ q{Ì00000004017 12246225402 017342 0 ustar 00nateware 000000 000000
TEST
CGI-FormBuilder-3.09/t/PaxHeader/2d-template-fast.t 000644 777777 777777 00000000214 12246226374 021757 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715790
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2d-template-fast.t 000644 € _$D€ q{Ì00000013057 12246226374 020302 0 ustar 00nateware 000000 000000 #!/usr/bin/perl
# Copyright (c) Nate Wiger http://nateware.com.
# All Rights Reserved. If you're reading this, you're bored.
# 2d-template-fast.t - test CGI::FastTemplate support
use strict;
our $TESTING = 1;
our $DEBUG = $ENV{DEBUG} || 0;
our $LOGNAME = $ENV{LOGNAME} || '';
our $VERSION;
BEGIN { $VERSION = '3.09'; }
use Test;
use FindBin;
# use a BEGIN block so we print our plan before CGI::FormBuilder is loaded
our $SKIP;
BEGIN {
my $numtests = 4;
unshift @INC, "$FindBin::Bin/../lib";
plan tests => $numtests;
# try to load template engine so absent template does
# not cause all tests to fail
eval "require CGI::FastTemplate";
$SKIP = $@ ? 'skip: CGI::FastTemplate not installed here' : 0;
# success if we said NOTEST
if ($ENV{NOTEST}) {
ok(1) for 1..$numtests;
exit;
}
}
# Need to fake a request or else we stall
$ENV{REQUEST_METHOD} = 'GET';
$ENV{QUERY_STRING} = 'ticket=111&user=pete&replacement=TRUE';
use CGI::FormBuilder 3.09;
use CGI::FormBuilder::Test;
# Create our template and store it in a scalarref
my $template = <<'EOT';
User Info
Please update your info and hit "Submit".
$JS_HEAD
$START_FORM
$FIELDS
$SUBMIT
$FORM_END
EOT
my $fieldtmpl = <<'EOT';
$LABEL $FIELD $COMMENT
EOT
my $fieldinv = <<'EOT';
$LABEL $FIELD $COMMENT $ERROR
EOT
# What options we want to use, and what we expect to see
my @test = (
{
opt => { fields => [qw/name color/],
submit => 'No esta una button del resetto',
template => {
type => 'Fast',
define_nofile => {
form => $template,
field => $fieldinv,
field_invalid => $fieldinv,
}
},
validate => { name => 'NAME' },
},
mod => { color => { options => [qw/red green blue/],
label => 'Best Color', value => 'red' },
size => { value => 42 },
sex => { options => [[M=>'Male'],[F=>'Female']] }
},
},
{
opt => { fields => [qw/name color size/],
template => {
type => 'Fast',
define_nofile => {
form => $template,
field => $fieldinv,
field_invalid => $fieldinv,
}
},
values => {color => [qw/purple/], size => 8},
submit => 'Start over, boob!',
},
mod => { color => { options => [[white=>'White'],[black=>'Black'],[red=>'Green']],
label => 'Mom', },
name => { size => 80, maxlength => 80, comment => 'Fuck off' },
sex => { options => [[1=>'Yes'], [0=>'No'], [2=>'Maybe']],
label => 'Fuck me? ' },
},
},
{
opt => { fields => [qw/name color email/], submit => [qw/Update Delete/], reset => 0,
template => {
type => 'Fast',
define_nofile => {
form => $template,
field => $fieldinv,
field_invalid => $fieldinv,
}
},
values => {color => [qw/yellow green orange/]},
validate => { sex => [qw(1 3 5)] },
},
mod => { color => {options => [[red => 1], [blue => 2], [yellow => 3], [pink => 4]] },
size => {comment => '(unknown)', value => undef, force => 1 } ,
sex => {label => 'glass EYE fucker', options => [[1,2],[3,4],[5,6]] },
},
},
);
# Perl 5 is sick sometimes.
@test = @test[$ARGV[0] - 1] if @ARGV;
my $seq = $ARGV[0] || 1;
# Cycle thru and try it out
for (@test) {
my $form = CGI::FormBuilder->new(
debug => $DEBUG,
action => 'TEST',
title => 'TEST',
%{ $_->{opt} },
);
# the ${mod} key twiddles fields
while(my($f,$o) = each %{$_->{mod} || {}}) {
$o->{name} = $f;
$form->field(%$o);
}
#
# Just compare the output of render with what's expected
# the correct string output is now in external files.
# The seemingly extra eval is required so that failures
# to import the template modules do not kill the tests.
# (since render is called regardless of whether $SKIP is set)
#
my $out = outfile($seq++);
my $ren;
eval '$ren = $form->render';
warn $@ if $@ && ! $SKIP;
my $ok = skip($SKIP, $ren, $out);
if (! $ok && $LOGNAME eq 'nwiger') {
open(O, ">/tmp/fb.1.html");
print O $out;
close O;
open(O, ">/tmp/fb.2.html");
print O $ren;
close O;
system "diff /tmp/fb.1.html /tmp/fb.2.html";
exit 1;
}
}
# MORE TESTS DOWN HERE
# from eszpee for tmpl_param
skip($SKIP, do{
my $form2 = CGI::FormBuilder->new(
template => {
type => 'Fast',
define_nofile => {
form => '$TEST',
}
},
);
$form2->tmpl_param(TEST => "this message should appear");
eval '$form2->render';
}, 'this message should appear');
CGI-FormBuilder-3.09/t/PaxHeader/2d-test01.html 000644 777777 777777 00000000214 12246225402 021021 x ustar 00nateware 000000 000000 18 gid=1896053708
18 uid=1596212229
20 ctime=1385780796
20 atime=1385780736
23 SCHILY.dev=16777220
23 SCHILY.ino=26715791
18 SCHILY.nlink=1
CGI-FormBuilder-3.09/t/2d-test01.html 000644 € _$D€ q{Ì00000003651 12246225402 017343 0 ustar 00nateware 000000 000000
User Info
Please update your info and hit "Submit".