Skip to content

Commit 7133158

Browse files
George Grozdevoalders
authored andcommitted
Test case for Issue #26
1 parent 576f4bf commit 7133158

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

t/issue26.t

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use strict;
2+
use Test::More;
3+
use HTTP::Cookies;
4+
use HTTP::Response;
5+
use HTTP::Request;
6+
7+
my $CRLF="\015\012";
8+
9+
my $cookie_jar = HTTP::Cookies->new();
10+
11+
my $request = HTTP::Request->new(GET => 'http://www.en.com/');
12+
13+
my $response = HTTP::Response->parse
14+
("HTTP/1.1 302 Moved" . $CRLF . "Set-Cookie: expires=10101$CRLF$CRLF");
15+
16+
$response->request($request);
17+
18+
$cookie_jar->extract_cookies($response);
19+
20+
is $cookie_jar->as_string(), 'Set-Cookie3: expires=10101; path="/"; domain=www.en.com; discard; version=0' . "\n";
21+
22+
done_testing;

0 commit comments

Comments
 (0)