Change 11952 by jhi@alpha on 2001/09/09 00:27:15

        Subject: [PATCH MANIFEST, lib/CGI/t/fast.t] Added Test for CGI::Fast
        From: "chromatic" <[EMAIL PROTECTED]>
        Date: Sat, 08 Sep 2001 12:31:44 -0600
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/MANIFEST#547 edit
... //depot/perl/lib/CGI/t/fast.t#1 add

Differences ...

==== //depot/perl/MANIFEST#547 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~   Sat Sep  8 18:30:06 2001
+++ perl/MANIFEST       Sat Sep  8 18:30:06 2001
@@ -802,6 +802,7 @@
 lib/CGI/t/apache.t              See if CGI::Apache still loads
 lib/CGI/t/carp.t                See if CGI::Carp works
 lib/CGI/t/cookie.t              See if CGI::Cookie works
+lib/CGI/t/fast.t               See if CGI::Fast works (if FCGI is installed)
 lib/CGI/t/form.t               See if CGI.pm works
 lib/CGI/t/function.t           See if CGI.pm works
 lib/CGI/t/html.t               See if CGI.pm works

==== //depot/perl/lib/CGI/t/fast.t#1 (text) ====
Index: perl/lib/CGI/t/fast.t
--- perl/lib/CGI/t/fast.t.~1~   Sat Sep  8 18:30:06 2001
+++ perl/lib/CGI/t/fast.t       Sat Sep  8 18:30:06 2001
@@ -0,0 +1,35 @@
+#!./perl -w
+
+use vars qw( $CGI::Q $CGI::Fast::Ext_Request );
+
+my $fcgi;
+BEGIN {
+       chdir 't' if -d 't';
+
+       # unshift, don't assign, so FCGI can be found if it's installed
+       # unlikely, but possible
+       unshift @INC, '../lib';
+
+       local $@;
+       eval { require FCGI };
+       $fcgi = $@ ? 0 : 1;
+}
+
+use Test::More tests => 7;
+
+SKIP: {
+       skip( 'FCGI not installed, cannot continue', 7 ) unless $fcgi;
+
+       use_ok( CGI::Fast );
+       ok( my $q = CGI::Fast->new(), 'created new CGI::Fast object' );
+       is( $q, $CGI::Q, 'checking to see if the object was stored properly' );
+       is( $q->param(), (), 'no params' );
+
+       ok( $q = CGI::Fast->new({ foo => 'bar' }), 'creating obect with params' );
+       is( $q->param('foo'), 'bar', 'checking passed param' );
+
+       # if this is false, the package var will be empty
+       $ENV{FCGI_SOCKET_PATH} = 0;
+       is( $CGI::Fast::Ext_Request, '', 'checking no active request' );
+
+}
End of Patch.

Reply via email to