logo       

BUGFIX: t/forward.t - problem with HTML::FillInForm >= 1.07: msg#00040

Subject: BUGFIX: t/forward.t - problem with HTML::FillInForm >= 1.07
"make test" on CGI::Application::Plugin::ValidatorRM was failing on
t/forward.t.
    t/forward........NOK 2
    #   Failed test 'form is returned'
    #   in t/forward.t at line 22.
    #          got: 'legacy form output HUH'
    #     expected: 'legacy form output'
    t/forward........NOK 4
    #   Failed test 'form is returned'
    #   in t/forward.t at line 56.
    #          got: 'forward form output
HUH'                                       #     expected: 'forward form
output'
    # Looks like you failed 2 tests of 4.
    t/forward........dubious
            Test returned status 2 (wstat 512, 0x200)
    DIED. FAILED tests 2, 4
            Failed 2/4 tests, 50.00% okay

I searched, and found an existing recent problem report with the
same error, but no fix:

http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/msg06154.html
Subject: Re: Problem installing the CGI::Application::Pliugin::Session and
ValidateRM


The problem is that the t/forward.t test has a workaround in it for a bug
in HTML::FillInForm <= 1.06. The FillInForm bug can be seen with the
following:

    use HTML::FillInForm;
    my $src ="one two three";
    my $res = HTML::FillInForm->new->fill( scalarref => \$src );
    print "[$src][$res]\n";

Which results in "[one two three][one two]" under FillInForm 1.06.
This doesn't normally cause a problem, because templates and files generally
end in a newline character, which will get chomped, but won't be missed
by anyone.


FillInForm >= 1.07 fixed this by changing the last part of sub fill to
include "$self->eof;":
    # diff -c HTML-FillInForm-1.0[67]/lib/HTML/FillInForm.pm
    *** 89,94 ****
    --- 95,102 ----
            $self->parse($_);
          }
        }
    +
    +   $self->eof;
        return delete $self->{output};
      }



Here's a patch for t/forward.t to make it compatable with both the old
and new HTML::FillInForm.
------BEGIN PATCH------
--- t/forward.t 2007-09-23 04:40:13.000000000 -0400
+++ t/forward_new.t     2007-09-23 04:55:26.000000000 -0400
@@ -12,7 +12,8 @@
     sub legacy_form { my $self = shift;
         Test::More::is($self->get_current_runmode, 'legacy_process', "if
             ::Forward is not loaded, current_rm is not updated");
-        $self->header_type('none'); return "legacy form output HUH"; }
+        $self->header_type('none');
+        return ($HTML::FillInForm::VERSION <= 1.06) ? "legacy form output
HUH" : "legacy form output"; }

     sub legacy_process { my $self = shift; my ($results, $err_page) =
         $self->check_rm('legacy_form', { required => 'fail' }); return
@@ -42,7 +43,7 @@
         Test::More::is($self->get_current_runmode, 'forward_form',
             "if ::Forward is loaded, current_rm is updated");
         $self->header_type('none');
-        return "forward form output HUH";
+        return ($HTML::FillInForm::VERSION <= 1.06) ? "forward form output
HUH" : "forward form output";
     }

     sub forward_process {
------END PATCH------

Thanks,
--
Josh I.
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe