Integrate with perlio; (strictly) readonly hashes via XS.
[p5sagit/p5-mst-13.2.git] / lib / CGI / t / fast.t
CommitLineData
b38b066d 1#!./perl -w
2
3use vars qw( $CGI::Q $CGI::Fast::Ext_Request );
4
5my $fcgi;
6BEGIN {
7 chdir 't' if -d 't';
8
9 # unshift, don't assign, so FCGI can be found if it's installed
10 # unlikely, but possible
11 unshift @INC, '../lib';
12
13 local $@;
14 eval { require FCGI };
15 $fcgi = $@ ? 0 : 1;
16}
17
18use Test::More tests => 7;
19
20SKIP: {
21 skip( 'FCGI not installed, cannot continue', 7 ) unless $fcgi;
22
23 use_ok( CGI::Fast );
24 ok( my $q = CGI::Fast->new(), 'created new CGI::Fast object' );
25 is( $q, $CGI::Q, 'checking to see if the object was stored properly' );
26 is( $q->param(), (), 'no params' );
27
28 ok( $q = CGI::Fast->new({ foo => 'bar' }), 'creating obect with params' );
29 is( $q->param('foo'), 'bar', 'checking passed param' );
30
31 # if this is false, the package var will be empty
32 $ENV{FCGI_SOCKET_PATH} = 0;
33 is( $CGI::Fast::Ext_Request, '', 'checking no active request' );
34
35}