Skip to content

Commit

Permalink
more keep-alive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 14, 2015
1 parent fa2ff9b commit 2330a02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/mojo/user_agent.t
Expand Up @@ -383,6 +383,7 @@ isnt $tx->res->body, 'Hello GZip!', 'different content';

# Fork-safety
$tx = $ua->get('/');
ok $tx->keep_alive, 'keep connection alive';
is $tx->res->body, 'works!', 'right content';
my $last = $tx->connection;
my $port = $ua->server->url->port;
Expand All @@ -393,12 +394,16 @@ is $ua->server->url->port, $port, 'same port';
{
local $$ = -23;
$tx = $ua->get('/');
ok !$tx->kept_alive, 'kept connection not alive';
ok $tx->keep_alive, 'keep connection alive';
is $tx->res->body, 'works!', 'right content';
isnt $tx->connection, $last, 'new connection';
isnt $ua->server->url->port, $port, 'new port';
$port = $ua->server->url->port;
$last = $tx->connection;
$tx = $ua->get('/');
ok $tx->kept_alive, 'kept connection alive';
ok $tx->keep_alive, 'keep connection alive';
is $tx->res->body, 'works!', 'right content';
is $tx->connection, $last, 'same connection';
is $ua->server->url->port, $port, 'same port';
Expand Down

0 comments on commit 2330a02

Please sign in to comment.