| Line | |
|---|
| 1 | #!./perl -w
|
|---|
| 2 |
|
|---|
| 3 | use lib qw(t/lib);
|
|---|
| 4 |
|
|---|
| 5 | # Due to a bug in older versions of MakeMaker & Test::Harness, we must
|
|---|
| 6 | # ensure the blib's are in @INC, else we might use the core CGI.pm
|
|---|
| 7 | use lib qw(blib/lib blib/arch);
|
|---|
| 8 |
|
|---|
| 9 | my $fcgi;
|
|---|
| 10 | BEGIN {
|
|---|
| 11 | local $@;
|
|---|
| 12 | eval { require FCGI };
|
|---|
| 13 | $fcgi = $@ ? 0 : 1;
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | use Test::More tests => 7;
|
|---|
| 17 |
|
|---|
| 18 | # Shut up "used only once" warnings.
|
|---|
| 19 | () = $CGI::Q;
|
|---|
| 20 | () = $CGI::Fast::Ext_Request;
|
|---|
| 21 |
|
|---|
| 22 | SKIP: {
|
|---|
| 23 | skip( 'FCGI not installed, cannot continue', 7 ) unless $fcgi;
|
|---|
| 24 |
|
|---|
| 25 | use_ok( CGI::Fast );
|
|---|
| 26 | ok( my $q = CGI::Fast->new(), 'created new CGI::Fast object' );
|
|---|
| 27 | is( $q, $CGI::Q, 'checking to see if the object was stored properly' );
|
|---|
| 28 | is( $q->param(), (), 'no params' );
|
|---|
| 29 |
|
|---|
| 30 | ok( $q = CGI::Fast->new({ foo => 'bar' }), 'creating obect with params' );
|
|---|
| 31 | is( $q->param('foo'), 'bar', 'checking passed param' );
|
|---|
| 32 |
|
|---|
| 33 | # if this is false, the package var will be empty
|
|---|
| 34 | $ENV{FCGI_SOCKET_PATH} = 0;
|
|---|
| 35 | is( $CGI::Fast::Ext_Request, '', 'checking no active request' );
|
|---|
| 36 |
|
|---|
| 37 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.