Commit | Line | Data |
b38b066d |
1 | #!./perl -w |
2 | |
3 | use vars qw( $CGI::Q $CGI::Fast::Ext_Request ); |
4 | |
5 | my $fcgi; |
6 | BEGIN { |
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 | |
18 | use Test::More tests => 7; |
19 | |
20 | SKIP: { |
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 | } |