summaryrefslogtreecommitdiff
path: root/lib/CGI/t
diff options
context:
space:
mode:
authorchromatic <chromatic@wgz.org>2001-09-08 06:31:44 -0600
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-09 00:27:15 +0000
commitb38b066d1cf1b115dd83bdf7e4355e8870134fb9 (patch)
treedd52f96ce3b8a4446e4a6922fb92c071a8682012 /lib/CGI/t
parent2528d3bc80636e23626826fbc1655948615de50f (diff)
downloadperl-b38b066d1cf1b115dd83bdf7e4355e8870134fb9.tar.gz
Added Test for CGI::Fast
Message-ID: <20010908183612.49960.qmail@onion.perl.org> p4raw-id: //depot/perl@11952
Diffstat (limited to 'lib/CGI/t')
-rw-r--r--lib/CGI/t/fast.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/CGI/t/fast.t b/lib/CGI/t/fast.t
new file mode 100644
index 0000000000..2374d9fe77
--- /dev/null
+++ b/lib/CGI/t/fast.t
@@ -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' );
+
+}