"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/cookie.t" between
CGI-Lite-3.01.tar.gz and CGI-Lite-3.02.tar.gz

About: CGI-Lite is a Perl module to decode form and query information, including file uploads, as well as cookies in a very simple manner.

cookie.t  (CGI-Lite-3.01):cookie.t  (CGI-Lite-3.02)
skipping to change at line 111 skipping to change at line 111
my $ref = []; my $ref = [];
$ref = $cgi->get_ordered_keys; $ref = $cgi->get_ordered_keys;
is_deeply ($ref, [' foo ', 'b a z'], is_deeply ($ref, [' foo ', 'b a z'],
'get_ordered_keys arrayref for cookie data'); 'get_ordered_keys arrayref for cookie data');
my @ref = $cgi->get_ordered_keys; my @ref = $cgi->get_ordered_keys;
is_deeply (\@ref, [' foo ', 'b a z'], is_deeply (\@ref, [' foo ', 'b a z'],
'get_ordered_keys array for cookie data'); 'get_ordered_keys array for cookie data');
SKIP: { SKIP: {
skip "No file created for stdout", 2 unless open my $tmp, '>', 'tmpout'; my $tmpfile = 'tmpout-cookie';
skip "No file created for stdout", 2 unless open my $tmp, '>', $tmpfile;
select $tmp; select $tmp;
$cgi->print_data; $cgi->print_data;
close $tmp; close $tmp;
open $tmp, '<', 'tmpout'; open $tmp, '<', $tmpfile;
chomp (my $printed = <$tmp>); chomp (my $printed = <$tmp>);
is ($printed, q# foo = bar #, 'print_data first cookie'); is ($printed, q# foo = bar #, 'print_data first cookie');
chomp ($printed = <$tmp>); chomp ($printed = <$tmp>);
is ($printed, q#b a z = qu ux#, 'print_data second cookie'); is ($printed, q#b a z = qu ux#, 'print_data second cookie');
close $tmp and unlink 'tmpout'; close $tmp and unlink $tmpfile;
} }
# Other url-escaped chars here # Other url-escaped chars here
for my $special (33 .. 47, 58 .. 64, 91 .. 96, 123 .. 126) { for my $special (33 .. 47, 58 .. 64, 91 .. 96, 123 .. 126) {
$ENV{HTTP_COOKIE} = sprintf 'a=%%%X;%%%X=1', $special, $special; $ENV{HTTP_COOKIE} = sprintf 'a=%%%X;%%%X=1', $special, $special;
$cgi = CGI::Lite->new (); $cgi = CGI::Lite->new ();
$cookies = $cgi->parse_cookies; $cookies = $cgi->parse_cookies;
$testname = "Special value ($ENV{HTTP_COOKIE})"; $testname = "Special value ($ENV{HTTP_COOKIE})";
is ($cgi->is_error, 0, "Cookie parse ($testname)"); is ($cgi->is_error, 0, "Cookie parse ($testname)");
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)