-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic subroutine test coverage for several methods that currently have zero test coverage
- Loading branch information
Showing
10 changed files
with
105 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ sub do_sleep { | |
sleep($delay); | ||
} else { | ||
select(undef,undef,undef,$delay); | ||
return $delay; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/local/bin/perl | ||
|
||
# coverage for testing that doesn't sit elsewhere | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Test::More tests => 25; | ||
use Test::Deep; | ||
use Test::Warn; | ||
|
||
use CGI (); | ||
|
||
# Set up a CGI environment | ||
$ENV{REQUEST_METHOD} = 'GET'; | ||
$ENV{QUERY_STRING} = 'game=chess&game=checkers&weather=dull'; | ||
|
||
isa_ok( my $q = CGI->new,'CGI' ); | ||
|
||
# undocumented ->r method, seems to be a temp store? | ||
$q->r( 'foo' ); | ||
is( $q->r,'foo','r' ); | ||
|
||
diag( "cgi-lib.pl routines" ); | ||
|
||
ok( $q->ReadParse,'ReadParse' ); | ||
is( $q->PrintHeader,$q->header,'PrintHeader' ); | ||
is( $q->HtmlTop,$q->start_html,'HtmlTop' ); | ||
is( $q->HtmlBot,$q->end_html,'HtmlBot' ); | ||
|
||
cmp_deeply( | ||
[ my @params = CGI::SplitParam( "foo\0bar" ) ], | ||
[ qw/ foo bar /], | ||
'SplitParam' | ||
); | ||
|
||
ok( $q->MethGet,'MethGet' ); | ||
ok( ! $q->MethPost,'MethPost' ); | ||
ok( ! $q->MethPut,'MethPut' ); | ||
|
||
note( "TIE methods" ); | ||
ok( ! $q->FIRSTKEY,'FIRSTKEY' ); | ||
ok( ! $q->NEXTKEY,'NEXTKEY' ); | ||
ok( ! $q->CLEAR,'CLEAR' ); | ||
|
||
is( $q->version,$CGI::VERSION,'version' ); | ||
is( $q->as_string,'<ul></ul>','as_string' ); | ||
|
||
is( ( $q->_style )[0],'<link rel="stylesheet" type="text/css" href="" />','_style' ); | ||
is( $q->state,'http://localhost','state' ); | ||
|
||
$CGI::NOSTICKY = 0; | ||
ok( $q->nosticky( 1 ),'nosticky' ); | ||
is( $CGI::NOSTICKY,1,' ... sets $CGI::NOSTICKY' ); | ||
|
||
$CGI::NPH = 0; | ||
ok( $q->nph( 1 ),'nph' ); | ||
is( $CGI::NPH,1,' ... sets $CGI::NPH' ); | ||
|
||
$CGI::CLOSE_UPLOAD_FILES = 0; | ||
ok( $q->close_upload_files( 1 ),'close_upload_files' ); | ||
is( $CGI::CLOSE_UPLOAD_FILES,1,' ... sets $CGI::CLOSE_UPLOAD_FILES' ); | ||
|
||
cmp_deeply( | ||
$q->default_dtd, | ||
[ | ||
'-//W3C//DTD HTML 4.01 Transitional//EN', | ||
'http://www.w3.org/TR/html4/loose.dtd' | ||
], | ||
'default_dtd' | ||
); | ||
|
||
ok( ! $q->private_tempfiles,'private_tempfiles' ); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters