X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=t%2F2_fill_18_coderef.t;h=46556fe68da1949de4992dda2b7e46b671a5ebc5;hb=4eee158dce82376f2f37de29d91c53f60a24aebe;hp=f09b3b05432eb44d6b423798fed1e87b0a7f7e67;hpb=85070b46d0a93ddbeef07341421adb8389a55418;p=chaz%2Fp5-CGI-Ex diff --git a/t/2_fill_18_coderef.t b/t/2_fill_18_coderef.t index f09b3b0..46556fe 100644 --- a/t/2_fill_18_coderef.t +++ b/t/2_fill_18_coderef.t @@ -1,14 +1,15 @@ # -*- Mode: Perl; -*- -use strict; +=head1 NAME -$^W = 1; +2_fill_18_coderef.t - Test CGI::Ex::Fill's ability to use coderef callbacks -print "1..4\n"; +=cut -use CGI::Ex; +use strict; +use Test::More tests => 4; -print "ok 1\n"; +use_ok('CGI::Ex::Fill'); my $ok2 = 0; my $ok3 = 0; @@ -24,16 +25,12 @@ my $cdat = sub { return ($key eq 'foo2') ? 'bar2' : ''; }; -my $fif = new CGI::Ex; -my $output = $fif->fill(scalarref => \$hidden_form_in, - fdat => [\%fdat, $cdat]); +my $output = CGI::Ex::Fill::form_fill($hidden_form_in, + [\%fdat, $cdat]); + +ok($ok2); +ok($ok3); -print "" . ($ok2 ? "" : "not ") . "ok 2\n"; -print "" . ($ok3 ? "" : "not ") . "ok 3\n"; +ok($output =~ m/^\s*$/, + "Should match ($output)"); -if ($output =~ m/^\s*$/){ - print "ok 4\n"; -} else { - print "Got unexpected out for hidden form:\n$output\n"; - print "not ok 4\n"; -}